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 :'));