[BlueOnyx:16620] Re: Help with permissions please :)

Michael Stauber mstauber at blueonyx.it
Thu Dec 4 16:04:35 -05 2014


Hi Colin,

> If I put any URL in the CURLOPT_URL that isn't on that server (e.g. http://bbc.co.uk) then it pulls the data fine.
> If I put in the URL of the real site (which is on the same vhost) then it fails - hangs for a while and then displays " bool(false)"

Weird. Shouldn't make a difference if the URL is remote or not.

Could you please try this instead:

$url = 'http://www.domain.com';
$ch = curl_init();
$timeout = 5;
curl_setopt($ch,CURLOPT_URL,$url);
curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch,CURLOPT_TIMEOUT,$timeout);
curl_setopt($ch,CURLOPT_CONNECTTIMEOUT,$timeout);
$error = curl_error($ch);
$data = curl_exec($ch);
if($data === false) {
    $data = $error;
}
curl_close($ch);
echo "<pre>";
print_r($data);
echo "</pre>";

If that doesn't fetch anything, it at least should give a more
descriptive error message.

-- 
With best regards

Michael Stauber



More information about the Blueonyx mailing list