How to write verbose information into file? How to write verbose information into file? curl curl

How to write verbose information into file?


Running on a Unix based OS? Use the below on the command line to run your script. Using Windows OS, use the command on Cygwin.

php yourPhp.php > yourFile.txt

Or you can just run it in verbose mode with a file handle

<?PHP$verbosPath = __DIR__.DIRECTORY_SEPARATOR.'verboseOut.txt';echo "Saving verbose output to: $verbosPath\n";$handle=curl_init('http://www.google.com/');curl_setopt($handle, CURLOPT_VERBOSE, true);curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);curl_setopt($handle, CURLOPT_STDERR,$f = fopen($verbosPath, "w+"));curl_exec($handle);fclose($f);?>