FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » PHP does not flush output on IIS7 ..
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: PHP does not flush output on IIS7 .. [message #178596 is a reply to message #178594] Tue, 10 July 2012 11:02 Go to previous messageGo to previous message
brillisoft is currently offline  brillisoft
Messages: 5
Registered: July 2012
Karma:
Junior Member
On Tuesday, July 10, 2012 12:53:50 PM UTC+2, (unknown) wrote:
> The following PHP program was flushing output correctly on an old Win2000 server with IIS 5.x - but refuses to do the same on a Windows 2008 64 bits server running IIS7.
>
> Rather than throwing a line on the browser every second as coded, it waits the entire loop, buffers the result, and prints all at once when the code ends running.

header("Content-Type: text/html; charset=utf-8");

function flush_buffers(){
ob_end_flush();
ob_flush();
flush();
ob_start();
}

ob_start();
flush_buffers();
echo "starting...<br/>\n";
for($i = 0; $i < 3; $i++) {
flush_buffers();
print "$i<br/>\n";
flush_buffers();
sleep(2);
}

flush_buffers();

print "DONE!<br/>\n";


$myFile = "test.php";
$fh = fopen($myFile, 'r');
$source = fread($fh, filesize($myFile));
$source = htmlspecialchars($source);

print "<p><hr>Here is the code of this program:<pre>\n";
echo $source;
flush()
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Extracting multiple matches from a string using preg_replace
Next Topic: Check out www.phpscribble.com
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Tue Nov 26 09:25:55 GMT 2024

Total time taken to generate the page: 0.03715 seconds