Blogger Information
Blog 7
fans 0
comment 0
visits 7914
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
关于nginx flush ob_flush无效问题
yushilei的博客
Original
2185 people have browsed it

今天测试一个程序在本地一切ok,放到服务器nginx就出问题了,在网上找了半天才解决

ignore_user_abort(true); // 后台运行
set_time_limit(0); // 取消脚本运行时间的超时上限
 ob_end_clean();
 ob_implicit_flush(true);
 for ($i=200; $i>0; $i--)
 {
 echo $i;
 sleep(1);
 }

上面这个程序本地ok,放在nginx就出问题,不能逐行输出,用以下方法就可以解决:

在网站配置文件加上

proxy_buffering off;
gzip off;
fastcgi_keep_conn on;

检查php.ini,禁用buffering:

output_buffering = off

在测试就ok了,详细请看 https://blog.csdn.net/jinyif/article/details/52525274?utm_source=blogxgwz7

Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post