Work on a Unix-based OS? Use the following command on the command line to run the script. Using Windows, use the command in Cygwin.
php yourPhp.php > yourFile.txt
Or you can just run it in verbose mode using a file descriptor
<?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); ?>
source share