<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=iso-8859-1" http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 8.00.6001.18702">
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT size=2 face=Arial>Ken - The PHP directive / PHP.INI setting is of no
use, as the webserver is compressing and buffering the output.</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial>You might want to consider turning the gzip on and
off depending on the location. According to <A
href="http://wiki.nginx.org/NginxHttpGzipModule">http://wiki.nginx.org/NginxHttpGzipModule</A></FONT><FONT
face=Arial><FONT size=2> gzip on | off is supported down to a location
level.</FONT></FONT></DIV>
<DIV><FONT face=Arial><FONT size=2></FONT></FONT> </DIV>
<DIV><FONT face=Arial><FONT size=2>Did you need to change the
fastcgi_buffer_size variable? Best to change one variable at a time and figure
what causes / fixes the problem (and change back to see if the old symptoms
reappear).</FONT></FONT></DIV>
<DIV><FONT face=Arial><FONT size=2></FONT></FONT> </DIV>
<DIV><FONT face=Arial><FONT size=2>Regards,</FONT></FONT></DIV>
<DIV><FONT face=Arial><FONT size=2>Shri</FONT></FONT></DIV>
<DIV><FONT face=Arial><FONT size=2> </DIV></FONT></FONT>
<BLOCKQUOTE
style="BORDER-LEFT: #000000 2px solid; PADDING-LEFT: 5px; PADDING-RIGHT: 0px; MARGIN-LEFT: 5px; MARGIN-RIGHT: 0px">
<DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
<DIV
style="FONT: 10pt arial; BACKGROUND: #e4e4e4; font-color: black"><B>From:</B>
<A title=ken73.chen@gmail.com href="mailto:ken73.chen@gmail.com">Ken Chen</A>
</DIV>
<DIV style="FONT: 10pt arial"><B>To:</B> <A title=nginx@sysoev.ru
href="mailto:nginx@sysoev.ru">nginx@sysoev.ru</A> </DIV>
<DIV style="FONT: 10pt arial"><B>Sent:</B> Thursday, April 30, 2009 2:03
AM</DIV>
<DIV style="FONT: 10pt arial"><B>Subject:</B> Re: php flush() are not
effective.</DIV>
<DIV><BR></DIV>hi Shri,<BR><BR>Thanks a lot! It works.<BR><BR>I change the
nginx configuration to:<BR><BR>fastcgi_buffer_size 4k;<BR>gzip
off;<BR><BR>And PHP script:<BR><BR><?php<BR><BR>ob_flush();<BR>echo The
first line<br />";<BR>flush();<BR>sleep(2);<BR><BR>for ($i=10; $i>0;
$i--)<BR>{<BR> echo $i . "<br
/>";<BR> echo str_repeat(" ",4096);<BR>
ob_flush();<BR> flush();<BR>
sleep(1);<BR>}<BR>ob_end_flush();<BR>?><BR><BR>But how do you implement
them to the productive server? <BR><BR>Set 'zlib.output_compression = On' in
php.ini, and only compress static content in nginx.conf
?<BR><BR><BR>Regards,<BR>Ken<BR><BR>
<DIV class=gmail_quote>2009/4/29 Shri @ DevLib.Org <SPAN dir=ltr><<A
href="mailto:shri@devlib.org">shri@devlib.org</A>></SPAN><BR>
<BLOCKQUOTE
style="BORDER-LEFT: rgb(204,204,204) 1px solid; MARGIN: 0pt 0pt 0pt 0.8ex; PADDING-LEFT: 1ex"
class=gmail_quote>
<DIV bgcolor="#ffffff">
<DIV><FONT size=2 face=Arial>I've noticed this too. Can you retry after
turning gzip off? Worked in my case. </FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial>We have some scripts which run for 20-30 mins,
rebuilding some large databases and they need to be run isolated from the
main webserver which has gzip on.</FONT></DIV>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<DIV><FONT size=2 face=Arial>Regards,<BR><FONT
color=#888888>Shri</FONT></FONT></DIV>
<DIV>
<DIV></DIV>
<DIV class=h5>
<DIV><FONT size=2 face=Arial></FONT> </DIV>
<BLOCKQUOTE
style="BORDER-LEFT: rgb(0,0,0) 2px solid; PADDING-LEFT: 5px; PADDING-RIGHT: 0px; MARGIN-LEFT: 5px; MARGIN-RIGHT: 0px">
<DIV
style="FONT: 10pt arial; font-size-adjust: none; font-stretch: normal">-----
Original Message ----- </DIV>
<DIV
style="FONT: 10pt arial; BACKGROUND: rgb(228,228,228); font-size-adjust: none; font-stretch: normal; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial"><B>From:</B>
<A title=ken73.chen@gmail.com href="mailto:ken73.chen@gmail.com"
target=_blank>Ken Chen</A> </DIV>
<DIV
style="FONT: 10pt arial; font-size-adjust: none; font-stretch: normal"><B>To:</B>
<A title=nginx@sysoev.ru href="mailto:nginx@sysoev.ru"
target=_blank>nginx@sysoev.ru</A> </DIV>
<DIV
style="FONT: 10pt arial; font-size-adjust: none; font-stretch: normal"><B>Sent:</B>
Wednesday, April 29, 2009 11:20 PM</DIV>
<DIV
style="FONT: 10pt arial; font-size-adjust: none; font-stretch: normal"><B>Subject:</B>
php flush() are not effective.</DIV>
<DIV><BR></DIV>Hi all,<BR><BR>I am trying to flush content before the end
of PHP script. With below script, it works under lighttpd, but not work
after changing to nginx. <BR><BR><?php<BR><BR>ob_flush();<BR>echo "The
first line<br />";<BR>flush();<BR>sleep(2);<BR><BR>for ($i=10;
$i>0; $i--)<BR>{<BR> echo $i . "<br
/>";<BR># echo str_repeat("
",8192);<BR> ob_flush();<BR>
flush();<BR>
sleep(1);<BR>}<BR>ob_end_flush();<BR>?><BR></BLOCKQUOTE></DIV></DIV></DIV></BLOCKQUOTE></DIV><BR></BLOCKQUOTE></BODY></HTML>