- 
                Notifications
    You must be signed in to change notification settings 
- Fork 113
Closed
Labels
Description
Situation:
- You are using JsSse to send server-side updates to clients
- You. are having an environment with Apache and PHP-FPM, buffering pages
- The default in PHP-FPM under Apache is output buffering which destroys the possibility to use Sse, as the request will only be sent out to client if complete (or buffer size of typically 4096 is reached)
Solution:
- Configure PHP-FPM in Apache module to allow flush by this configuration in php-fpm.conf for example:
    <FilesMatch ".+\.ph(?:ar|p|tml)$">
        SetHandler "proxy:unix:/run/php/php8.2-fpm.sock|fcgi://localhost"
    </FilesMatch>
    <Proxy "fcgi://localhost">
        ProxySet flushpackets=on
        ProxySet flushwait=20
        ProxySet max=10
        ProxySet timeout=100
    </Proxy>
Suggestions to limit flushing packets only on selected scripts or directories are welcome. This way you can keep output buffering for scripts that are non-Sse.
Also see:
php/php-src#12785 (comment)