AWS上Bitnami WordPress站点PayPal支付异常问题排查求助
Root Cause
The core error from PayPal is INVALID_EXPERIENCE_PROFILE_ID – the experience_profile_id (XP-XBUK-SGDC-PKH3-4ZFW) being sent in the API request does not exist in your connected PayPal Sandbox account. This 400 error causes the theme's JavaScript to fail, resulting in the page refresh instead of redirecting to PayPal's login screen:

Since the same theme and PayPal credentials work on another server, the issue is specific to your AWS Bitnami environment, not the theme or PayPal itself.
Step-by-Step Solutions
Verify Experience Profile ID in PayPal
Log into your PayPal Sandbox account, navigate to Profile Settings > Website Payment Preferences, or use the PayPal API to list existing experience profiles. Confirm ifXP-XBUK-SGDC-PKH3-4ZFWis present. If not, remove this ID from your theme's PayPal settings to use the default profile.Disable Custom Experience Profile
Check your WordPress theme's PayPal configuration panel for an option to use a custom experience profile. Disable this setting so PayPal uses your account's default payment experience.Clear All Caches
Bitnami WordPress setups include server-level caching (Apache/NGINX, Redis) and often WP caching plugins. Clear:- WordPress plugin cache (e.g., WP Rocket, W3 Total Cache)
- Bitnami server cache: Run
sudo /opt/bitnami/ctlscript.sh restart apache(or nginx) to flush server caches - Browser cache to ensure you're loading the latest settings
Check Server Security Modules
Bitnami may have mod_security or other security tools enabled that modify outgoing API requests. Review your Apache/NGINX config files to ensure requests toapi.sandbox.paypal.comare not being blocked or altered. Temporarily disable mod_security to test if the error resolves.Reconnect PayPal Credentials
In your theme's settings, disconnect and re-authenticate your PayPal app. This can refresh the connection and ensure the correct profile IDs are being pulled from your account.Isolate Theme/Plugin Conflict
Switch to a default WordPress theme (e.g., Twenty Twenty-Three) and install a standard PayPal plugin (like PayPal Payments). If payments work, the issue is a compatibility bug between your theme and the Bitnami server environment – reach out to the theme developer with this specific context.
Additional Troubleshooting
- Enable WordPress debug mode by adding
define('WP_DEBUG', true);to yourwp-config.phpfile. Check for PHP errors that might be altering the API request payload. - Review Bitnami's server logs (
/opt/bitnami/apache2/logs/error_logor/opt/bitnami/nginx/logs/error.log) for any outgoing request errors to PayPal.
内容的提问来源于stack exchange,提问作者Dantes

