[olug] streaming data (text/stream) and PHP

Lou Duchez lou at paprikash.com
Tue Jul 28 16:52:25 CDT 2020


So if you've tried to send streaming data to a browser via PHP and 
Apache, you may have found that, no matter what you do, you can't get 
the server to not insist on sending data in 4k chunks.  The culprit for 
me was PHP-FPM, and here's how I got around it:

https://stackoverflow.com/questions/33628918/disabling-output-buffer-with-apache-and-php-fpm-via-mod-proxy

So the answer is, set up a new Proxy in your Virtual Host configuration, 
something like this:

|<FilesMatch\.php$>SetHandler 
"proxy:unix:/run/php-fpm/php-fpm.sock|fcgi://localhost" 
</FilesMatch><Proxyfcgi://localhost>ProxySet enablereuse=on 
flushpackets=on </Proxy> |



More information about the OLUG mailing list