Print Curl Verbose Info on the web browser in php

By default, the CURLOPT_VERBOSE option will print verbose info to the stderr stream. If you want to print the verbose info to the stdout stream and make it visible to the web browser it’s easy:

PHP:


			  curl_setopt($hCurl, CURLOPT_STDERR, fopen('php://output', 'w+'));
			  curl_setopt($hCurl, CURLOPT_VERBOSE, 1);

  • I just want to say that this is the fifth time in 6 months that I read this article. It’s still in my bookmarks, and it’s really useful.
    Thank you !

  • Awesome quick fix – just what I needed , Thanks!