Put this at the top of your php script:
set_time_limit(0); @apache_setenv('no-gzip', 1);//comment this out if you use nginx instead of apache @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);
which could disable all caching of the web server or php, which makes your output displayed in the browser while the script is running.
Note the comment on the apache_setenv line if you use the nginx web server instead of apache.
Update for nginx:
So, OP uses nginx, which makes things a little more complicated, since nginx does not allow you to disable gzip compilation with PHP. I also use nginx, and I just found out that it is active by default, see:
cat /etc/nginx/nginx.conf | grep gzip gzip on; gzip_disable "msie6";
so you need to disable gzip on nginx.conf and restart nginx:
/etc/init.d/nginx restart
or you can play with gzip_disable or gzip_types to conditionally disable gzip for some browsers or for some types of page content, respectively.
Nelson
source share