note 31870 added to function.file
| From: | john at mesilla dot com | Date: | Wed, 07 May 2003 15:44:22 +0000 |
| Subject: | note 31870 added to function.file | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-47625@lists.php.net to get a copy of this message | ||
Trying some simple fopen() and file() on our FreeBSD machine
(php v4.0.6), and am running into the most irritating problem.
When using file() to get a tiny remote text file (via HTTP), sometimes the damn thing works, and
later on that day, it doesn't... no error though, just a never-ending hang. Sometimes it
actually succeeds, after hanging for 2+ minutes...
I know I should probably just set up a cron job to wget this text file, but this way really should
work too:
<?php
$weather = file ('http://a.small.four/line/textfile.txt');
echo $weather[0];
echo $weather[1];
echo $weather[2];
echo $weather[3];
?>
etc...
I know it's an oversimplified example, but it _should_ work, and it _does_ work, but then it
wont work for a few hours, then it will...
(the small text file is always present on the remote server, so that's not the issue)
Comments? Help? Please? :)
--
http://www.php.net/manual/en/function.file.php
http://master.php.net/manage/user-notes.php?action=edit+31870
http://master.php.net/manage/user-notes.php?action=delete+31870
http://master.php.net/manage/user-notes.php?action=reject+31870