开发者

PHP cURL problem from local

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?


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜