Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>If you are running this script from the command line, output buffering is always off, and implicit flush is always on (according to <a href="http://us3.php.net/manual/en/outcontrol.configuration.php" rel="nofollow noreferrer">http://us3.php.net/manual/en/outcontrol.configuration.php</a> ). Because of this, I suspect you are running this PHP within a web server.</p> <p>There are several PHP INI values which affect buffering, so you may wish to turn off these features:</p> <pre><code>&lt;?php ini_set('zlib.output_compression', 'off'); ini_set('implicit_flush', 'on'); ini_set('output_buffering', 'off'); echo "While Loop is going to start.\n"; $i = 0; while($i &lt;= 10){ echo "Now number is ".$i."\n&lt;br&gt;\n"; $i++; sleep(1); } echo "\n&lt;br&gt;Finished running script\n\n"; ?&gt; </code></pre> <p>Even after all that, it's possible that PHP is behaving exactly as you want, but your web server is buffering the output. This thread may be of interest: <a href="https://stackoverflow.com/questions/4706525/php-flush-not-working">php flush not working</a></p> <p>If you are using apache, you can add a line to an .htaccess file to turn off gzip compression (which automatically buffers until there's enough data to compress and send) I found this page (<a href="http://www.bluehostforum.com/showthread.php?18996-Turning-off-Gzip" rel="nofollow noreferrer">http://www.bluehostforum.com/showthread.php?18996-Turning-off-Gzip</a>) which describes the process, but it basically says to add </p> <pre><code>SetEnv no-gzip dont-vary </code></pre> <p>to your .htaccess file.</p> <p>Can you confirm that the script I posted above works as you'd expect in your command line environment or not?</p> <p>Also, if you are working within a web server, please post which web server you're using (IIS/apache/etc)</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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