I’m trying to run a simple PHP script on MAMP. I’m using PHP 5.2.17 and I have compression turned off. Im trying to execute this simple script
<?php
ob_flush();
foreach(range(1,9) as $n){
echo $n."\n";
flush();
sleep(1);
}
For sme reason this is not doing what it is supposed to. Rather than sequentially echoing out the numbers, it’s simply echoing them out when the loop is done. Am I missing something? is there another way to do this?
Note: Output buffering can also be controlled via Output Buffering Control
functions.
php.ini Possible Values:
Note: This directive is hardcoded to Off for the CLI SAPI
http://php.net/output-buffering
A Working example if output_buffering is set to 4096