Jaypoc
2011-09-15 19:07:02 UTC
When I run CURL from a bash shell, it works regardless of what site I call.
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'http://www.mysite.com');
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$contents = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
if($contents) {
echo $contents;
} else {
echo curl_error($ch);
}
curl_close($ch);
?>
In addition, I don't see any errors in the apache logfiles. What could be blocking the requests? Is there additional configuration for cURL that I can't find that would enable/disable remote requests?
From my PHPINFO:
cURL support enabled
libcurl/7.18.2 OpenSSL/0.9.8g zlib/1.2.3.3 libidn/1.8 libssh2/0.18
Apache/2.2.9 (Debian) PHP/5.2.6-1+lenny9 with Suhosin-Patch mod_python/3.3.1 Python/2.5.2
mod_ssl/2.2.9 OpenSSL/0.9.8g mod_perl/2.0.4 Perl/v5.10.0