Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>FINAL SOLUTION</p> <p>So that's what I found out:</p> <p>Flush would not work under Apache's mod_gzip or Nginx's gzip because, logically, it is gzipping the content, and to do that it must buffer content to gzip it. Any sort of web server gzipping would affect this. In short, at the server side, we need to disable gzip and decrease the fastcgi buffer size. So:</p> <ul> <li><p>In php.ini:</p> <p>. output_buffering = Off</p> <p>. zlib.output_compression = Off</p></li> <li><p>In nginx.conf:</p> <p>. gzip off;</p> <p>. proxy_buffering off;</p></li> </ul> <p>Also have this lines at hand, specially if you don't have acces to php.ini:</p> <ul> <li><p>@ini_set('zlib.output_compression',0);</p></li> <li><p>@ini_set('implicit_flush',1);</p></li> <li><p>@ob_end_clean();</p></li> <li><p>set_time_limit(0);</p></li> </ul> <p>Last, if you have it, coment the code bellow:</p> <ul> <li><p>ob_start('ob_gzhandler');</p></li> <li><p>ob_flush();</p></li> </ul> <p><strong>PHP test code:</strong></p> <pre><code>ob_implicit_flush(1); for($i=0; $i&lt;10; $i++){ echo $i; //this is for the buffer achieve the minimum size in order to flush data echo str_repeat(' ',1024*64); sleep(1); } </code></pre> <p>Related:</p> <ul> <li><p><a href="https://stackoverflow.com/questions/4706525/php-flush-not-working/4978642#4978642">php flush not working</a></p></li> <li><p><a href="https://stackoverflow.com/questions/3133209/how-to-flush-output-after-each-echo-call/4763130#4763130">How to flush output after each `echo` call?</a></p></li> <li><p><a href="https://stackoverflow.com/questions/3483035/php-flushing-output-as-soon-as-you-call-echo/4768650#4768650">PHP flushing output as soon as you call echo</a></p></li> </ul>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload