I use CURL to fetch XML output from another webserver. Several days ago, it stopped working.
I created a testpage and it quits after timing out. If I run curl example.com or execute the php script on the server (sudo -u nobody php testcurl.php), it works. It just doesn't work when called by apache.
No idea what went wrong though.
testcurl.php code snippet:
echo curl_version();
$sURL = "http://www.example.com";
$ch = curl_init($sURL);
curl_setopt ($ch, CURLOPT_VERBOSE, 1);
curl_setopt ($ch, CURLOPT_URL, $sURL);
curl_setopt ($ch, CURLOPT_HEADER, 0);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($ch, CURLOPT_TIMEOUT, 60);
curl_exec($ch);
echo "<p>".curl_error($ch);
curl_close ($ch);
btw, I do have curl compiled into PHP ('--with-curl=../curl-7.10.3') and the version of PHP is 4.3.7