Bug 64978

Summary: Error log entries from php-fpm are concatenated in Apache vhost error log
Product: Apache httpd-2 Reporter: molecularbear
Component: mod_proxy_fcgiAssignee: Apache HTTPD Bugs Mailing List <bugs>
Status: NEW ---    
Severity: normal    
Priority: P2    
Version: 2.4.34   
Target Milestone: ---   
Hardware: PC   
OS: Linux   

Description molecularbear 2020-12-12 23:32:19 UTC
I am using mod_proxy_fcgi to proxy requests to php-fpm 7.3.11 with a configuration very similar to this: https://cwiki.apache.org/confluence/display/HTTPD/PHP-FPM

I used the following config at the php-fpm pool level in order to get PHP errors/warnings/notices/etc to appear in the vhost's error log:

php_admin_value[error_log] =
php_admin_flag[log_errors] = on

This works, _except_ that all the PHP errors emitted by a request are concatenated within a single log entry in the vhost error log. Example:

[Sat Dec 12 17:26:22.819678 2020] [proxy_fcgi:error] [pid 15779] [client 10.223.109.206:49916] AH01071: Got error 'PHP message: PHP Notice:  TEST 123 in /www/public/test.php on line 3PHP message: PHP Notice:  TEST ABC in /www/public/test.php on line 5'

My expectation is that each PHP error would result in a _separate_ log entry, similar to how mod_php behaves. The concatenation unfortunately breaks some of my monitoring/alerting, as well as being difficult to read.

I recognize that I can log PHP errors to separate files via PHP or FPM config, but I do not want to rework my monitoring/alerting setup.

Should errors coming back over mod_proxy_fcgi not be logged in separate entries? Thank you for considering!