Skip to content

Instantly share code, notes, and snippets.

@Crowles
Last active July 6, 2016 13:54
Show Gist options
  • Save Crowles/bb2e80d5b87dea899e2d0ccebb6654dc to your computer and use it in GitHub Desktop.
Save Crowles/bb2e80d5b87dea899e2d0ccebb6654dc to your computer and use it in GitHub Desktop.
<?php
// ==============================================================================
// BEGIN VERBOSE DEBUGGING
curl_setopt($ch, CURLOPT_VERBOSE, true);
$verbose = fopen('php://temp', 'w+');
curl_setopt($ch, CURLOPT_STDERR, $verbose);
$result = curl_exec($ch);
if ($result === 0) {
printf("cUrl error (#%d): %s<br>\n", curl_errno($ch),
htmlspecialchars(curl_error($ch)));
}
// END VERBOSE DEBUGGING
// ===============================================================================
rewind($verbose);
$verboseLog = stream_get_contents($verbose);
echo "Verbose information:\n<pre>", htmlspecialchars($verboseLog), "</pre>\n";
die;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment