file() problems [newbie]
| From: | MVCS | Date: | Wed, 07 May 2003 17:19:09 +0000 |
| Subject: | file() problems [newbie] | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-146712@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? :)