PHP-FPM Always returns 200 response code regardless PHP errors.
php container:
display_errors = Off
log_errors = On
httpd container:
<IfModule proxy_module>
<FilesMatch \.php$>
SetHandler "proxy:fcgi://php:9000"
</FilesMatch>
</IfModule>
index.php
// infinite loop
while (true) {}
// or parser error
wh ile (true) {}
Produces page
Parse error: syntax error, unexpected 'ile' (T_STRING) in /var/www/html/index.php on line 10
With response status 200
Logs
php | 172.22.0.1 - 21/Jan/2019:12:59:03 +0000 "GET /index.php" "http://example.local/" status:200 /var/www/html/web/index.php took:286.962ms mem:18432Kb cpu:83.63%
php | [21-Jan-2019 12:59:03] WARNING: [pool www] child 122 said into stderr: "NOTICE: PHP message: PHP Parse error: syntax error, unexpected 'ile' (T_STRING) in /var/www/html/index.php on line 10"
httpd | [Mon Jan 21 12:59:04.001447 2019] [proxy_fcgi:error] [pid 8:tid 140486365661928] [client 172.22.0.1:59478] AH01071: Got error 'PHP message: PHP Parse error: syntax error, unexpected 'ile' (T_STRING) in /var/www/html/index.php on line 10\n'
httpd | example.local 172.22.0.1 - - [21/Jan/2019:12:59:03 +0000] "GET / HTTP/1.1" 200 115 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36"
UPD 1
I've reproduced this behaviour with any php:*-fpm-*
image from Docker hub without any modification in php config.
UPD 2
Test repo to reproduce the behaviour https://github.com/mahnunchik/php-fpm-response-code