Please Read Before you mark as CLONE to this
I am running xampp on my local machine and when testing by writing http://localhost/test.php I am getting the desired output i.e. printing 1 to 10 after each second. But as soon as I change it to my local IP http://10.70.52.75/test.php it loads for 10 seconds and gives output in one shot. I actually need this method to collect output from a PHP script which will be running for 10-15 minutes.
Alredy checked the php.ini for buffering as off.
apache_setenv('no-gzip', 1); //can comment this line
header('Content-Encoding: none');
header( 'Content-type: text/html; charset=utf-8' );
for ($i=0; $i<10; $i++) {
echo $i.'<br>';
flush();
ob_flush();
sleep(1);
}
Tried all the hacks available on stackoverflow
- PHP Flush/ob_flush not working
- Calling ob_flush() and flush(), yet browser doesn't show any output until script finishes and much more but did not get the correct one. Please try to run the code on your Linux server or try on my setup
http://host-1-89.linuxzoo.net/test.php
ssh to this machine with root@linuxzoo.net Password is "secure"
Let me know any one succeed in any way