Log in

No account? Create an account

Getting unbuffered output from PHP

« previous entry | next entry »
Jun. 26th, 2007 | 02:59 pm
mood: accomplishedaccomplished
music: afc

While it should be easy, when you combine two complex systems (Apache and PHP), it's actually quite complex.

First, mod_gzip will buffer output. It needs to be disabled for the relevant requests. I don't know whether or not disabling it by response header works, or if it must be done before the script is called.

Secondly, zlib in PHP will buffer output if it is switched on in php.ini, even if you disable it at runtime before producing output! Disabling it in php.ini fixes this. Disabling it by apache directive ought to work too, but I have not tested this.

Finally, ob_implicit_flush() should be called. Setting the implicit flush ini directive is not enough.

Link | Leave a comment |

Comments {0}