PHP - Display cURL Verbose info

curl, php, stderr

Solution

My guess is that you need to also return the buffer. This code works under Linux and might work for you under Win2008:

$browser = curl_init();
curl_setopt($browser, CURLOPT_URL, $url);
curl_setopt($browser, CURLOPT_RETURNTRANSFER, true);
curl_setopt($browser, CURLOPT_VERBOSE, true);
$data = curl_exec($browser);
echo $data;

Problem

I'm having some trouble with a particular cURL command and I'd like to see the headers and responses. In the command line I use -v and it displays everything, however... In PHP I'm attempting to use: ``` curl_setopt($curl, CURLOPT_VERBOSE, 1); ``` However, nothing is being displayed. I'm using PHP 5.3.24 on Windows Server 2008 on IIS. Supposedly the info is sent into the stderr stream which I assume means the regular log used for PHP errors - however nothing is going there either. I'm getting no header results for cURL commands that I know are working and those that I know are not working.

Original source