This article through the example code to introduce the PHP nginx real-time output simple implementation method, very good, has the reference value, needs the friend reference
PHP open Real-time output method is Ob_implicit_flush (),
But it doesn't work in most cases,
Because most of the output_buffering output buffers in the php.ini configuration are on,
And zlib.output_compression are often turned on,
In addition to the PHP layer, there are Nginx buffer settings proxy_buffering, and compression gzip is also mostly open.
For the one or two page requirements, modify the entire server site configuration, I am afraid no one will make this choice.
Here's an easy way to do this:
Set_time_limit (0); Ob_end_clean (); Ob_implicit_flush (); header (' X-accel-buffering:no '); The key is to add this line. Echo ' is now: '. Date (' H:i:s '). ' <br> '; sleep (5); Echo ' Five seconds later: '. Date (' h:i:s ');
Summarize
The above is a small series to introduce you to the PHP nginx real-time output of the simple implementation method, I hope to have some help, if you have any questions welcome to my message, small series will promptly reply to everyone!
Articles you may be interested in:
PHP Comment Syntax specification and naming specification
PHP language comments, single-line comments and multi-line comments related content
Phpstorm regular match Delete blank line, Comment line