Phpcurl common errors: SSL errors, bool (false)

Source: Internet
Author: User
Tags http 200
An error occurred while calling https in phpcurl. troubleshooting method: Use curl in the command line. cause: unable to verify the SSL certificate in the server room. Solution: Skip the SSL certificate check. the code is as follows:

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. the code is as follows:

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 method: var_dump (curl_error ($ ch ));

Return value: string (23) "Empty reply from server"

The code is as follows:

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: The code is as follows: curl_setopt ($ ch, CURLOPT_HTTPHEADER, array ('CT :'));

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.