PHP DOC says:
flush() may not be able to override the buffering scheme of your web server and it has no effect on any client-side buffering in the browser. It also doesn't affect PHP's userspace output buffering mechanism. This means you will have to call both ob_flush() and flush() to flush the ob output buffers if you are using those.
Several servers, especially on Win32, will still buffer the output from your script until it terminates before transmitting the results to the browser.
Server modules for Apache like mod_gzip may do buffering of their own that will cause flush() to not result in data being sent immediately to the client.
Even the browser may buffer its input before displaying it. Netscape, for example, buffers text until it receives an end-of-line or the beginning of a tag, and it won't render tables until the </table> tag of the outermost table is seen.
Some versions of Microsoft Internet Explorer will only start to display the page after they have received 256 bytes of output, so you may need to send extra whitespace before flushing to get those browsers to display the page.
I tried with some of these variations
Code: Select all
In php.ini:
. output_buffering = Off
. zlib.output_compression = Off
In nginx.conf:
. gzip off;
. proxy_buffering off;
disable mod_security
echo str_repeat(" ", 1024), "\n"; at the start of the script.
output_handler =
zlib.output_handler =
ResponseBufferLimit=0
but on uberspace my testscript only responded flushing with:
Code: Select all
ob_implicit_flush(1); and echo str_repeat(' ',1024*64);
So I just committed this to autoupdate in the hope it will work on next update session. If anyone is able to update Serendipity on uberspace (or others using fastcgi and/or nginx) with this even earlier, please drop me a line about your experiences.
Edit: I added ob_flush() too.