Use curl in the command line to call the method for skipping the SSL certificate check. For more information, see. Symptom: An error occurred while calling https in php curl.
Troubleshooting method: Use curl in the command line to call it.
Cause: The SSL certificate cannot be verified in the server room.
Solution: Skip the SSL certificate check.
Curl_setopt ($ ch, CURLOPT_SSL_VERIFYPEER, false );
Symptom: php curl calls curl_exec and returns bool (false). the command line curl call is normal.
Troubleshooting: Var_dump (curl_error ($ ch ));
Return value:
String (23) "Empty reply from server"
Troubleshoot: Curl_setopt ($ ch, CURLOPT_HEADER, true );
Curl_setopt ($ ch, CURLOPT_RETURNTRANSFER, false );
Return value: HTTP/1.1 100 Continue
Connection: close
Cause: php curl ends when it receives HTTP 100. it should continue to receive HTTP 200.
Solution: Curl_setopt ($ ch, CURLOPT_HTTPHEADER, array ('CT :'));
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 has Ded a very simple script to do so. it had worked fine in the past, but for some reason barfed in this case. A closer look at what was being returned revealed that for some reason, Apache was prepending the 'normal' headers with an extra response header:
HTTP/1.1 100 Continue
HTTP/1.1 200 OK Date: Fri, 09 Jun 2006 15:23:42 GMT
Server: Apache
... A bit of Googling revealed that this was to do with a header that cURL sends by default:
Secondary CT: 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:
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.