Symptom: Php Curl calls HTTPS error
Troubleshooting: Try using Curl on the command line.
Cause: The server's computer room cannot verify the SSL certificate.
Workaround: Skip the SSL certificate check.
curl_setopt ($ch, Curlopt_ssl_verifypeer, false);
Symptom: Php Curl call Curl_exec returns BOOL (false), command line curl is called normally.
How to Troubleshoot:
Var_dump (Curl_error ($ch));
Return:
String (Reply) "Empty from server"
Further troubleshooting:
curl_setopt ($ch, Curlopt_header, true);
curl_setopt ($ch, Curlopt_returntransfer, false);
Return:
http/1.1 Continue
Connection:close
Cause: Php Curl received HTTP 100 ended, should continue to receive HTTP 200
Solution:
curl_setopt ($ch, Curlopt_httpheader, Array (' Expect: '));
PHP and curl:disabling 100-continue header
Published June 15th, 2006
I ' ve been using CURL (through PHP) to build a sort of proxy for a project I ' m working on. I need to parse the returned headers (to recover the HTTP status), so had included a very simple script to do. It had worked fine in the past, but is some reason barfed in this case. A closer look at what is being returned revealed that for some reason, Apache is prepending the ' normal ' headers with an Extra response Header:
http/1.1 Continue
http/1.1 OK Date:fri, June 2006 15:23:42 GMT
Server:apache
... A bit of googling revealed that this is to does with a header that is CURL sends by default:
Expect:100-continue
... which in turns tells Apache to send the extra header. I poked around a fair bit but couldn ' t quite find a workable solution short of manually removing the header in PHP, which Seemed a bit clumsy. Finally, on a hunch I tried this:
curl_setopt ($curl _handle, Curlopt_httpheader, Array (' Expect: '));
... which basically overrides the original ' Expect: ' Header with an empty one.
Hope this helps someone.
The above describes the PHP Curl common error: SSL error, Boolfalse, including aspects of the content, want to be interested in PHP tutorial friends helpful.