Knowing the PHP curl_exec function, it is the execution of a given curl session. Returns TRUE if successful, or FALSE on failure.
Sometimes when PHP uses Curl requests, the page is blank and nothing is output. Debug Discovery Returns the result: false, what should I do if I encounter this situation? This article describes the workaround when the PHP curl_exec function returns false
We use examples to give you a demonstration, I believe you will see more clearly.
The first is an example of a curl request;
Request return result: false;
debugging, typing curl error number; Tip: Problem (2) in the chunked-encoded data
Workaround:
In
$output = curl_exec ($CURLP);
Before adding the following paragraph:
curl_setopt ($CURLP, curlopt_http_version, CURL_HTTP_VERSION_1_0);
The meaning of this passage is:
curl_setopt-Set a curl transfer option.
For details, refer to the curl_setopt () function in the Curl function of the PHP manual
Run again and find that the curl request returned a normal result.
"Related articles recommended"
Example of usage of 1.PHP curl_exec function
2. Share a workaround when PHP server does not support PHP curl_exec functions
3. PHP curl_exec function to get the output information of Curl request
4. PHP curl_exec () function curl Gets the return value of the method