PHP冲出缓冲区直接输出配置
muke
每日精进
muke
2023-06-12 20:15:01
753
{{single.collect_count}}

1.打开apache配置,

2.在httpd.conf文件中写入FcgidOutputBufferSize 0

3.重启apache

测试代码,每隔1秒回自动直接输出一个1,2,3,4,5

for($i=0;$i<10;$i++){
    echo $i;

    ob_flush();//刷新PHP自身缓冲区

    flush();//刷新(特指apache)web服务器的缓冲区,输出数据

    sleep(1);
}

 

回帖
全部回帖({{commentCount}})
{{item.user.nickname}} {{item.friend_time}}
{{item.content}}
{{item.comment_content_show ? '取消' : '回复'}} 删除
回帖
{{reply.user.nickname}} {{reply.friend_time}}
{{reply.content}}
{{reply.comment_content_show ? '取消' : '回复'}} 删除
回帖
收起
没有更多啦~
{{commentLoading ? '加载中...' : '查看更多评论'}}