For example I have something like this :
<?php
header("Content-Type: text/html; charset=UTF-8");
set_time_limit(0);
ob_start("ob_gzhandler");
while(true) :
echo microtime(true)."<br>";
ob_flush();
flush();
sleep(1);
endwhile;
ob_end_clean();
?>
This code works on my localhost
and each second on the page is printed microtime()
, but when I try to run same script on my Shared Linux Hosting
nothing is printed, page just has infinite loading time.
How to print something when in infinite loop, on my hosting?
Maybe I have to enable /disable something in my php.ini
file? any Ideas?