I’m trying something with curl in php.
I read about the use of CURLOPT_VERBOSE to help debugging.
But it gives no output. I checked my phpinfo() and under cURL stands:
debug => no
I guess that is the problem here. How can I set this to yes?
I looked in php.ini and could find it.
Also no luck on google.
also no luck here: How to enable features for php-curl
I hope someone can help me!
Having a debug build of cURL isn’t required for the
CURLOPT_VERBOSEsetting to work, but by defaultCURLOPT_VERBOSEinformation gets output toSTDERRwhich is only visible on the console. So if you are running PHP from a browser, the verbose output isn’t sent anywhere you can see.You can set the option
CURLOPT_STDERRto a file handle and the verbose output should be written there.You should be able to do this:
I’m not sure if I’m encountering a PHP bug at the moment (running PHP 5.4.5 via FastCGI) because I don’t see the verbose output in the browser, but if I run it from the command line I do. If I
fwriteto$stdoutI do see that output in the browser but still nothing from cURL so I know the handle is valid.If you experience the same issue, here is a workaround:
Hope that helps.