I am trying to get a WordPress plugin working on a client site. Among other things, the plugin sends a request to PayPal. The PHP script uses cURL to handle this request. The code excerpt is:
It crashes when it does the curl_exec statement. I get a 500 Internal Server Error back.
I have played with the options, but nothing I do changes the results. I'm beginning to think that I have a configuration or permissions problem of some kind. The error message suggest that more information about this error may be available in the server error log. I'm not sure what log this is or where I might find it.
I've spent a lot of time trying to figure this out and not getting anywhere. Any insights or suggestions would be most welcome.
Thanks in advance... John
Code: Select all
// Set the curl parameters.
$ch = curl_init();
//re: this bug http://curl.haxx.se/mail/lib-2010-06/0169.html
curl_setopt($ch, CURLOPT_SSLVERSION, 3);
curl_setopt($ch, CURLOPT_URL, $API_Endpoint);
curl_setopt($ch, CURLOPT_VERBOSE, 1);
// Turn off the server and peer verification (TrustManager Concept).
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, 1);
// Set the API operation, version, and API signature in the request.
$nvpreq = "METHOD=$methodName_&VERSION=$version&PWD=$API_Password&USER=$API_UserName&SIGNATURE=$API_Signature&$nvpStr_";
// Set the request as a POST FIELD for curl.
curl_setopt($ch, CURLOPT_POSTFIELDS, $nvpreq);
// Get response from the server.
$httpResponse = curl_exec($ch);
I have played with the options, but nothing I do changes the results. I'm beginning to think that I have a configuration or permissions problem of some kind. The error message suggest that more information about this error may be available in the server error log. I'm not sure what log this is or where I might find it.
I've spent a lot of time trying to figure this out and not getting anywhere. Any insights or suggestions would be most welcome.
Thanks in advance... John