TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
 
 
LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old 06-23-2009, 02:06 AM   #1 (permalink)
The Contributor
 
Join Date: Apr 2008
Posts: 78
Thanks: 0
benton is on a distinguished road
Default Simple script fails with php5

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
Code:
$file = @fopen($filename, "r");
if (!$file) 
{
  echo "<p>Unable to open remote file $filename.\n";
}
else
{          
  while (!feof($file)) 
  {
  }
}
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?
benton is offline  
Reply With Quote
 



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Creating a Simple Currency Converter with Automatic Symbols Wildhoney General 11 03-16-2010 05:22 PM
Part 2: Giving our Currency Conversion Script some Responsibility Wildhoney General 15 03-17-2009 01:53 PM
My first script ever , critisize !! webtuto Show Off 11 02-21-2008 01:06 PM
hash() algorithm info script RobertK Script Giveaway 4 01-09-2008 03:00 PM
Script Execution Time Class Wildhoney Script Giveaway 2 09-14-2007 11:36 PM


All times are GMT. The time now is 11:07 PM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design