How to disable output buffering on Apache 2.4.58 with mod_proxy_fcgi?

My WHM/cPanel server is running Apache 2.4.58 with the mod_proxy_fcgi module and so PHP scripts are served through PHP-FPM. If I toggle PHP-FPM off in WHM, then the PHP scripts successfully output DATA as soon as I call flush() or ob_flush() in PHP, but when PHP-FPM is turned on, the DATA is always arriving in the browser in 8KB chunks, meaning that if I echo anything less than 8KB it won’t be displayed until more DATA is echo’ed. I need to be able to flush() a single byte whenever I want and have it immediately displayed in the browser.

This is what the global php.ini file contains:

output_buffering = Off
zlib.output_compression = Off

Any idea what could be done to disable output buffering at least for one domain?

I have seen numerous posts on here but they all seem to be outdated, e.g. you have to flush at least 8KB for that single byte to display in the browser, which doesn’t sound like a decent solution.

Leave a Comment