Re: file_get_contents ($file) works -- file_get_contents ($url) returns false
| From: | Richard Quadling | Date: | Wed, 09 Dec 2009 14:05:13 +0000 |
| Subject: | Re: file_get_contents ($file) works -- file_get_contents ($url) returns false | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-300329@lists.php.net to get a copy of this message | ||
2009/12/9 René Fournier <m5@renefournier.com>:
> Strange problem I'm having on Mac OS X Server 10.6 running PHP 5.3. Any call of
> file_get_contents() on a local file works fine -- the file is read and returned. But any call of
> file_get_contents on a url -- any url, local or remote -- always returns false.
>
> var_dump (file_get_contents
> ('http://www.google.com/'));
>
> bool(false)
>
> I've checked php.ini, and the obvious seems okay:
>
> allow_url_fopen => On => On
>
> Any ideas?
>
> ...Rene
If you enable all errors, anything extra? ...
<?php
error_reporting(-1);
ini_set('display_errors', 1);
set_time_limit(0); // Just in case it takes more than your default
execution time.
var_dump(file_get_contents('http://www.google.com'));
--
-----
Richard Quadling
"Standing on the shoulders of some very clever giants!"
EE : http://www.experts-exchange.com/M_248814.html
Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498&r=213474731
ZOPA : http://uk.zopa.com/member/RQuadling