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.
php // Script to test if the CURL extension is installed on this server // Define function to test function _is_curl_installed() { if (in_array ('curl', get_loaded_extensions())) { return true; } else { return false; } } // Ouput text to user based on test if (_is_curl_installed()) { echo "cURL is <span style=\"color: ...
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;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With