1curl_setopt($handle, CURLOPT_VERBOSE, true);
2
3$verbose = fopen('php://temp', 'w+');
4curl_setopt($handle, CURLOPT_STDERR, $verbose);
5$result = curl_exec($handle);
6if ($result === FALSE) {
7 printf("cUrl error (#%d): %s<br>\n", curl_errno($handle),
8 htmlspecialchars(curl_error($handle)));
9}
10
11rewind($verbose);
12$verboseLog = stream_get_contents($verbose);
13
14echo "Verbose information:\n<pre>", htmlspecialchars($verboseLog), "</pre>\n";
15