note 31870 rejected from function.file by joey

From: Date: Wed, 07 May 2003 15:53:53 +0000
Subject: note 31870 rejected from function.file by joey
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-47626@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? :)

« previous php.notes (#47626) next »