It seems that despite everything i've done trying to get it to work, It just doesnt work.
Here's what all I did :
- output_buffering = 4096
- zlib.output_compression = Off
- Tried using ob_implicit_flush();
- Tried using ob_flush();
- Reduced the buffer size in the ini setting output_buffering to 1
Following is the code that i'm trying to get to work (basically output a line every 1 second) but i'm getting the entire output after 15 seconds.
With ob_implicit_flush() :
<?php
ob_implicit_flush();
for($i=0;$i<=15;$i++)
{
print($i."<BR />");
sleep(1);
}
with using ob_start() and ob_flush() methods :
<?php
ob_start();
for($i=0;$i<=15;$i++)
{
print($i."<BR />");
ob_flush();
}
Is there any other PHP setting that I am missing ? Please help.
EDIT : Using the example by the OP in this SO question, it works : PHP buffer why \r\n
I see that I had to do a str_repeat() to generate a string to overflow the buffer. Why is nothing of this mentioned in the php manual ? Is this really the procedure ?
ob_
* set of functions in the context of the samples. – Treffynnon