tags:

views:

19

answers:

1

Hey all,

Quick question : I have a PHP script which query Pinnacle Cart API through a cURL query. While testing this on my laptop, no problem. I get the XML response and all. But once it's on the remote server... I get no result. I checked beforehand to be sure cURL was installed on the remote server, and it sure is. I don't have the same version as the remote server (libcurl/7.15.5 vs libcurl/7.19.5) but I kind of doubt it's the issue here. Any idea what might throw off my script?

EDIT : Here is what I get when I output the errors to a file with CURLOPT_STDERR :

Locally :

  • successfully set certificate verify locations:
  • CAfile: none CApath: /etc/ssl/certs
  • SSL connection using DHE-RSA-AES256-SHA

Server-side :

  • successfully set certificate verify locations:
  • CAfile: /etc/pki/tls/certs/ca-bundle.crt CApath: none
  • SSL certificate problem, verify that the CA cert is OK. Details:error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed

1 minutes of googling later... I found out that with this parameter : curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); My script works on the server... But it's kind of butched, isn't it?

+1  A: 

See your PHP error log or turn the PHP's error reporiting functionality on so that it gives you the exact error message. Most probably PHP's safe_mode is open on your server and prevents some functionality (eg. CURLOPT_FOLLOWLOCATION) of curl library.

eyazici
along the same lines, enable the CURLOPT_VERBOSE option (and probably point CURLOPT_STDERR to a file for _VERBOSE to output to).
Frank Farmer
Yeah that's another issue, even though I use error_reporting(-1), I still don't see any error... But that may not be necessary with Frank's method. Also, I checked and the safe_mod is off in the php.ini (but I guess the value could be altered somewhere else)
Afrosimon