Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You can enable the <code>CURLOPT_VERBOSE</code> option and log that information to a (temporary) <code>CURLOPT_STDERR</code>:</p> <pre><code>// CURLOPT_VERBOSE: TRUE to output verbose information. Writes output to STDERR, // or the file specified using CURLOPT_STDERR. curl_setopt($handle, CURLOPT_VERBOSE, true); $verbose = fopen('php://temp', 'w+'); curl_setopt($handle, CURLOPT_STDERR, $verbose); </code></pre> <p>You can then read it after curl has done the request:</p> <pre><code>$result = curl_exec($handle); if ($result === FALSE) { printf("cUrl error (#%d): %s&lt;br&gt;\n", curl_errno($handle), htmlspecialchars(curl_error($handle))); } rewind($verbose); $verboseLog = stream_get_contents($verbose); echo "Verbose information:\n&lt;pre&gt;", htmlspecialchars($verboseLog), "&lt;/pre&gt;\n"; </code></pre> <p>(I originally <a href="https://stackoverflow.com/a/9571305/367456">answered similar but more extended</a> in a related question.)</p> <p>More information like metrics about the last request is available via <a href="http://php.net/curl_getinfo" rel="noreferrer"><code>curl_getinfo</code></a>. This information can be useful for debugging curl requests, too. A usage example, I would normally wrap that into a function:</p> <pre><code>$version = curl_version(); extract(curl_getinfo($handle)); $metrics = &lt;&lt;&lt;EOD URL....: $url Code...: $http_code ($redirect_count redirect(s) in $redirect_time secs) Content: $content_type Size: $download_content_length (Own: $size_download) Filetime: $filetime Time...: $total_time Start @ $starttransfer_time (DNS: $namelookup_time Connect: $connect_time Request: $pretransfer_time) Speed..: Down: $speed_download (avg.) Up: $speed_upload (avg.) Curl...: v{$version['version']} EOD; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload