Weird error!!

From: Date: Sat, 22 Jun 2002 03:52:39 +0000
Subject: Weird error!!
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-103376@lists.php.net to get a copy of this message
        Hi, i have this script that simply reads lines from a txt files and displays them on my site, itlists the first 4 entries of a txt file with the files that exist on a download page:
        <?
$linha=file('downs.txt'); $t=count($linha); $l = $t - 1; $fim = $l - 3; if ($l > 3) { $fim=$l - 3; } else { $fim = 0; } for ($i = $l; $i >= $fim ; $i--) {
    $array=explode("|",$linha[$i]);
        print("<div align=\"left\">");
        print("<span class=\"data\">$array[0]</span>");
        print("<br>$array[1]<br>");
        print("</div><img src=\"spacer.gif\" height=\"3\">");
        }
?>
        But from time to time, and with absolutely no visible reason, i get this error:
        Warning: php_network_getaddresses: getaddrinfo failed: No address associated with hostname in /usr/home/pagon/www/index.php on line 497
Warning: file("downs.txt") - Bad file descriptor in /usr/home/pagon/www/index.php on line 497
        I tried everything, but i cant figure out why i get this error, the paths are ok (otherwise it wouldnt work in the first place) what could possibly cause it? The script is so small and simple, is there something wrong in it? But if it is, why does the error only appears randomly?
        I get this error on a different script on my site, also of the same type, reading a few lines from a txt file and displaying them.
        Thanks.
        Pag


« previous php.general (#103376) next »