Steps to reproduce: 1) install Ubuntu 22.04 LTS. 2) update System 2.1) sudo su 2.2) apt-get update && apt-get dist-upgrade -y 3) install Apache, PHP-FPM and Dependencies 3.1) add-apt-repository ppa:ondrej/php 3.2) apt-get update && apt-get install apache2 libapache2-mod-fcgid php7.4-fpm brotli -y 4) Configure PHP-FPM 4.1) useradd default 4.2) mkdir /var/www/alternative/ ; chown default. /var/www/alternative/ 4.3) /etc/php/7.4/fpm/pool.d/default.conf [default] user = default group = default listen = /run/php/php7.4.sock listen.mode = 0660 listen.owner = www-data listen.group = www-data pm = ondemand pm.max_children = 15 4.4) service php7.4-fpm restart 5) configure Apache 5.1) a2enmod brotli proxy proxy_fcgi 5.2) /etc/apache2/apache2.conf ... Options Indexes FollowSymLinks AllowOverride All Require all granted ... 5.3) /etc/apache2/sites-enabled/000-default.conf ... DocumentRoot /var/www/alternative/ SetHandler "proxy:unix:/run/php/php7.4.sock|fcgi://localhost" ... 5.4) /etc/apache2/conf-enabled/z-server.conf LogLevel notice 5.5) service apache2 restart 6) create PHP script 6.1) /var/www/html/.htaccess SetEnv no-gzip 1 AddOutputFilterByType BROTLI_COMPRESS text/html 6.2) /var/www/html/.user.ini output_buffering = Off 6.3) /var/www/html/seg.php 7) curl -vvv --compressed -H 'Accept-Encoding: br' http://127.0.0.1/seg.php ---------------- directly connected to php-fpm over cgi-fcgi gives the expected 500 "Warning Messages" whereas curl (uncompressed) only giving 333 without any logged error and/or segmentation fault: #install package for cgi-fcgi apt-get install libfcgi-bin export REQUEST_METHOD=GET;export SCRIPT_NAME=/var/www/alternative/seg.php;export SCRIPT_FILENAME=/var/www/alternative/seg.php;cgi-fcgi -bind -connect /run/php/php7.4.sock 2>/dev/null | grep "Warning" -c #gives: 500 curl http://127.0.0.1/seg.php | grep "Warning" -c #gives: 333 cat /var/log/apache2/error.log | grep 00:00:00 (time of error) | grep Warning -c #gives: 500