If you are looking the debug curl_exec, you may wish to log its details, and analyze the various time points during its execution.
before curl_exec:
<?php
curl_setopt($curl, CURLOPT_VERBOSE, true);
curl_setopt($curl, CURLOPT_STDERR, fopen('/your/writable/app/logdir/curl.log', 'a+')); ?>
after curl_exec, but before curl_close:
<?php
extract(curl_getinfo($curl)); $appconnect_time = curl_getinfo($curl, CURLINFO_APPCONNECT_TIME); $downloadduration = number_format($total_time - $starttransfer_time, 9); $namelookup_time = number_format($namelookup_time, 9);
$metrics = "CURL...: $url Time...: $total_time DNS: $namelookup_time Connect: $connect_time SSL/SSH: $appconnect_time PreTransfer: $pretransfer_time StartTransfer: $starttransfer_time Download: $downloadduration";
error_log($metrics); ?>
Happy debugging