How can I flush the OUTPUT BUFFER?

software development

#1

Hello

THE SCRIPT DOES NOT HAVE BUGS, I need to know how to set the parameters for the SERVER to FLUSH. My browser flushes okay. PLEASE HELP, IT IS URGENT !!

<?php ob_implicit_flush ( TRUE ); echo " START "; $id = 0; while ( $id < 5 ) { $id++; echo " $id"; sleep(2); ob_flush(); flush (); } ?>

#2

Maybe it’s a problem caused by gzip compression on the server, try to disable it, for example, in .htaccess :

mod_gzip_on No


#3

did that fix your problem?

I am having the same issue and I put that in my .htaccess and still I can’t get PHP to flush.


#4

Er, actually, I just tried the php test and it didn’t work for me too :frowning: Disabling mod_gzip solved my problem with the output buffering in Perl…


#5

I’ve also had no luck getting flush() or ob_flush() to work in PHP. I’ve tried disabling mod_gzip, but I think apache or zend is still caching or using “deflate” on the output. Seaching php.net has turned up no other useful suggestions or demo code that actually works.

Any help would be greatly appreciated.