RE: Interesting problem - PHP 4.3, IIS5, ISAPI

From: Date: Sat, 15 Feb 2003 06:00:18 +0000
Subject: RE: Interesting problem - PHP 4.3, IIS5, ISAPI
References: 1  Groups: php.windows 
Request: Send a blank email to php-windows+get-18545@lists.php.net to get a copy of this message
also u r using wrong variable $fd in while loop while you have defined $fp, so this becomes infinite loop. this should give a warning message, if you have not disabled display of same. check your error logs. $fp = fopen("d:\www\ex030124.log", "r"); $i = 0; while (!feof($fp)) { $rowData = fgets($fd); /* if(substr($rowData, 1, 1) == "#") { $iisTitle = preg_split(":", $rowData, "1"); echo $iisTitle . "<BR>"; } */ $i++; //echo $i . "<BR>"; } regds, -----Original Message----- From: Matt Babineau [mailto:matt@criticalcode.com] Sent: Saturday, February 15, 2003 01:18 To: php-windows@lists.php.net Subject: Interesting problem - PHP 4.3, IIS5, ISAPI I am trying to output the page runtime to omake a comparison between php and Coldfusion. I have 2 functions one to start a timer, one to end a timer. The php code block in the middle between reads a 140mb file and does some other stuff. This is fairly unimportant at this point. With the code block in between the timer functions present, the timer functions don't output the processing time. When I remove the code block, the timer functions work great...I don't get it!! Help! CODE: -------------------------- <? function startTiming() { global $startTime; $microtime = microtime(); $microsecs = substr($microtime, 2, 8); $secs = substr($microtime, 11); $startTime = "$secs.$microsecs"; } startTiming(); ?> <HTML> <HEAD> <TITLE>Stats Server</TITLE> <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1"> </HEAD> <BODY> <? $fp = fopen("d:\www\ex030124.log", "r"); $i = 0; while (!feof($fp)) { $rowData = fgets($fd); /* if(substr($rowData, 1, 1) == "#") { $iisTitle = preg_split(":", $rowData, "1"); echo $iisTitle . "<BR>"; } */ $i++; //echo $i . "<BR>"; } ?> </BODY> </HTML> <? function stopTiming() { global $startTime; $microtime = microtime(); $microsecs = substr($microtime, 2, 8); $secs = substr($microtime, 11); $endTime = "$secs.$microsecs"; echo "<HR>Execution time " . ($endTime - $startTime) . " seconds."; } stopTiming(); ?>

« previous php.windows (#18545) next »