j,
dreamhost and paypal are pointing to ZC. let's verify that, by attempting a curl call outside of ZC. right now, you are timing out with a response time of 8.7 seconds. copy the following code into a new script; call it what you like, perhaps curl_test.php. load it onto the root folder of your domain, and then run it by calling www.yourdomain.com/curl_test.php. it will cause an error but we can see if it's safe to say its a ZC problem or not. frankly, i'm at dreamHost as well right now, and i think it's probably ZC, but lets just eliminate them from the problem.
Code:
<?php
$starttime = microtime_float();
echo "starting..."; flush();
$hostname_2 = 'https://api-3t.paypal.com/nvp';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$hostname_2);
curl_setopt($ch, CURLOPT_VERBOSE, 1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_DNS_USE_GLOBAL_CACHE, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_PORT,443);
$resp = curl_exec($ch);
$curlerror = false;
if (curl_errno($ch) ) {
$curlerror = curl_error($ch);
}
$endtime = microtime_float();
echo "\n<br/>elapsed time: " ; flush();
echo ($endtime - $starttime); flush();
echo "\n<br/>RESPONSE:<pre> " . $resp . ($curlerror ? " ERROR: $curlerror" : '') ."</pre><br/>\n";
function microtime_float()
{
list($usec, $sec) = explode(" ", microtime());
return ((float)$usec + (float)$sec);
}
i have it here:
www.rossroberts.com/curl_test.php
after uploading what do you get as an elapsed time? (an error is expected after the elapsed time...)
Bookmarks