I just had some problems with flush() and ob_flush(). What I did to resolve this problem took me some time to figure out so I'd like to share what I came up with.
The main problem is the php setting "output_buffering" which can be set too large and will prevent your text from outputting. To change this value you can either set it in php.ini or you can add the line
php_value output_buffering "0"
to your .htaccess file. It will not work with ini_set() since it is PHP_INI_PERDIR.
Next thing is to begin with ob_start();
Then you need
ob_flush();
flush();
before any echo or print.
Your code might look like this:
<?php
ob_start();
for($i=0;$i<70;$i++)
{
echo 'printing...<br />';
ob_flush();
flush();
usleep(300000);
}
?>
Hope this helps anyone with the same problems.
Title:
ob_flush flush output_buffering php.ini
Description:
I just had some problems with flush() and ob_flush(). What I did to resolve this problem took me some time to figure out so I'd like to ...
...
Rating:
4