For Programmers: Free Programming Magazines  


Home > Archive > PHP Documentation > May 2004 > #26238 [Ver]: flush() doesn't work with output_buffering = 4096









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author #26238 [Ver]: flush() doesn't work with output_buffering = 4096
Spam At Vrana Dot Cz

2004-05-27, 11:33 am

ID: 26238
User updated by: spam at vrana dot cz
Reported By: spam at vrana dot cz
Status: Verified
Bug Type: Documentation problem
Operating System: *
PHP Version: 4CVS, 5CVS
New Comment:

PHP-CLI has output_buffering always Off as of 4.3.5. For the others it
seems that output is flushed if both flush() and ob_flush() are called.


Previous Comments:
------------------------------------------------------------------------

[2004-02-18 18:33:52] scottmacvicar at ntlworld dot com

Setting output_buffering to a value causes it to create an ouput buffer
on startup using the default output handler. You can see this using
print_r(ob_get_status()); within the script.

ob_flush() should be used in this case rather than flush() since the
latter only calls the backends flush method. So i believe this bug is
bogus, though it could be a documentation problem.

------------------------------------------------------------------------

[2004-02-18 17:19:31] sniper@php.net

Here's nice and short reproduce script:

# php -d'output_buffering=2' -r 'while(1) {echo "."; flush(); sleep(1);
}'



------------------------------------------------------------------------

[2003-11-17 13:14:20] scottm at spamcop dot net

Confirmed.

If you set output_buffering = 3 then it will flush them in groups of
three.

Running RH9, apache 1.3.29 and PHP 4.3.4

------------------------------------------------------------------------

[2003-11-13 08:40:59] spam at vrana dot cz

Description:
------------
I have set output_buffering = 4096 and flush(), ob_implicit_flush(),
ob_flush() and similar functions doesn't work. This is reproducible in
PHP apache module, in PHP-CLI and also on Linux.

Reproduce code:
---------------
while (true) {
echo ".";
flush();
sleep(1);
}


Expected result:
----------------
.. (1 second) . (1 second) ...

Actual result:
--------------
nothing (for output_buffering seconds)


------------------------------------------------------------------------


--
Edit this bug report at http://bugs.php.net/?id=26238&edit=1
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com