Prev: request for support
Next: file_get_contents ($file) works -- file_get_contents ($url) returns false
From: =?iso-8859-1?Q?Ren=E9_Fournier?= on 9 Dec 2009 08:45 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
From: Richard Quadling on 9 Dec 2009 09:05 2009/12/9 René Fournier <m5(a)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
From: kranthi on 9 Dec 2009 09:30 may be unrelated to your problem... but are you behind a proxy?
From: LinuxManMikeC on 9 Dec 2009 10:02 On Wed, Dec 9, 2009 at 6:45 AM, René Fournier <m5(a)renefournier.com> wrote: > 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 http://us2.php.net/manual/en/filesystem.configuration.php#ini.allow-url-fopen
From: LinuxManMikeC on 9 Dec 2009 10:03 On Wed, Dec 9, 2009 at 8:02 AM, LinuxManMikeC <linuxmanmikec(a)gmail.com> wrote: > On Wed, Dec 9, 2009 at 6:45 AM, René Fournier <m5(a)renefournier.com> wrote: >> 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 > > http://us2.php.net/manual/en/filesystem.configuration.php#ini.allow-url-fopen > "I've checked php.ini" Right, must remember not to reply to stuff till I'm awake. :-D
|
Next
|
Last
Pages: 1 2 3 Prev: request for support Next: file_get_contents ($file) works -- file_get_contents ($url) returns false |