I have a script that used to work in PHP5.3 to handle buffering for a particular log file but after the server was upgraded to PHP5.5 it no longer works. The output needs to be html so I was hoping to simply flush output after each echo.
This is a cut-down test version of the code that used to work...
@apache_setenv('no-gzip', 1);
@ini_set('zlib.output_compression', 0);
@ini_set('implicit_flush', 1);
for ($i = 0; $i < ob_get_level(); $i++) { ob_end_flush(); }
ob_implicit_flush(1);
set_time_limit(0);
echo 'Start ...<br />';
for( $i = 0 ; $i < 10 ; $i++ )
{
echo $i . '<br />';
flush();
ob_flush();
sleep(1);
}
echo 'End<br />';
I suspect that the @ini_set commands are not over-riding the settings and I am just hoping for a simple example that will flush the output buffers. Most of the examples online are from 6+ years ago and none of them have worked. I read that buffering was re-written in PHP5.4 so I wonder if that is also to blame.