SOS! Why Nginx DID NOT flush buffer to client?

Rob Schultz rschultz7 at gmail.com
Tue Feb 9 19:52:28 MSK 2010


It doesn't matter as I believe NginX buffers fastcgi responses and  
then sends to the client once the request is completed.

V/r
Rob

Sent from my iPhone

On Feb 9, 2010, at 10:06 AM, Georgi Hristozov <georgi at forkbomb.nl>  
wrote:

> On 02/09/2010 10:29 AM, 21andy wrote:
>> I want to the php file output 1 line per second.
>>
>> see my code first:
>>
>> <?php
>>    ob_implicit_flush(true);
>>    for ($i = 0; $i < 5; $i++) {
>>        echo "test $i";
>>        sleep(1);
>>    }
>> ?>
>>
>> OR
>>
>> <?php
>>    ob_end_clean();
>>    for ($i = 0; $i < 5; $i++) {
>>        echo "test $i";
>>        flush();
>>        sleep(1);
>>    }
>> ?>
>>
>> Both not work, they output all the content after 5 seconds. NOT 1  
>> second 1 line.
>>
>> I tried to change nginx.conf
>> gzip on; AND gzip off;
>> and it still NOT 1 second 1 line.
>>
>> and I also tried to change php.ini
>> output_buffering = 4096
>> AND
>> output_buffering = 0
>> and it still NOT 1 second 1 line.
>>
>> HOW CAN I FIX IT ?
>> SOS!!!
>>
>> Posted at Nginx Forum: http://forum.nginx.org/read.php?2,52531,52531#msg-52531
>>
>>
>> _______________________________________________
>> nginx mailing list
>> nginx at nginx.org
>> http://nginx.org/mailman/listinfo/nginx
>>
> Hi,
>
> Try ob_end_flush() instead of ob_end_clean().
>
> /gh
>
> _______________________________________________
> nginx mailing list
> nginx at nginx.org
> http://nginx.org/mailman/listinfo/nginx



More information about the nginx mailing list