How to use PHP cURL with HTTP/1.1 How to use PHP cURL with HTTP/1.1 curl curl

How to use PHP cURL with HTTP/1.1


According to the documentation of curl_setopt() the code

curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);

should be correct. What did you mean with "curl stops working"? What's the actual error you get? You can also try extracting extra more details about the error:

# before curl_exec():error_reporting(~0);curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);curl_setopt($ch, CURLOPT_HEADER, true);curl_setopt($ch, CURLOPT_FAILONERROR, false);curl_setopt($ch, CURLOPT_VERBOSE, true);curl_setopt($ch, CURLOPT_STDERR, $filehandle);# maybe also: curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);# maybe also: curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);# after curl_exec():$curl_error = curl_error($ch);$curl_error_number = curl_errno($ch);$http_code = curl_getinfo($ch,CURLINFO_HTTP_CODE);