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

Colin Jack colin at mainline.uk
Thu Dec 4 16:25:46 -05 2014


Thanks Michael,

I agree that is weird, but it is happening :)

>
>> 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.
>

I will try your script and report back.

Colin





More information about the Blueonyx mailing list