I have a script that reads the file contents of a site. My host recently upgraded to php 5 and the script doesn't work correctly. It still runs without errors but takes much longer and no results are found. I've narrowed down the code to this
$file = @fopen($filename, "r");
echo "<p>Unable to open remote file $filename.\n";
If I remove the while (!feof($file)) line, the script executes quickly. If I leave it in, it takes almost a minute before it returns. I checked the php manual to see if there is a difference betwen these functions for php 4 and 5 but didn't find anything. Does anyone have any ideas as to why this fails when php 5 is enabled or any suggestions on another method?