PHP Flush that works… even in Nginx

前端 未结 8 929
既然无缘
既然无缘 2020-11-30 22:29

Is it possible to echo each time the loop is executed? For example:

foreach(range(1,9) as $n){
    echo $n.\"\\n\";
    sleep(1);
}

Instead

8条回答
  •  萌比男神i
    2020-11-30 23:12

    Easy solution on nginx server:

    fastcgi_keep_conn on; # < solution
    
    proxy_buffering off;
    gzip off;
    

提交回复
热议问题