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:
Var_dump (curl_error ($ ch ));
Return value:
String (23) "Empty reply from server"
Troubleshoot:
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 :')); |