HTTPD and PHP-FPM logs issues

Two httpd log issues

1. Details lacking the /var/log/httpd/ssl_error_log

RHEL7 creates the following log entry for a page not found
[:error] [pid 62113] [client ] script '/var/www/secure/html/test.php' not found or unable to stat

Rocky8 creates the following log entry for a page not found, with no page or path
[proxy_fcgi:error] [pid 115443:tid 140343501936384] [client ] AH01071: Got error 'Primary script unknown\n'

is there configuration to include the ‘not found’ page name and its path in the Rocky8 httpd log?

2. /var/log/httpd/ssl_error_log and /var/log/php-fpm/www-error.log
In RHEL7 I can get both httpd and php errors in the one log ssl_error_log
In Rocky8 (probably due to using fpm instead of ‘origianl’ php) I have to check ssl_error_log for httpd errors and www-error.log for any php errors.

Is there a way to send/copy fpm errors to the ssl_error_log?

thanks

php-fpm log file path you can can change in /etc/php-fpm.d/www.conf

php_admin_value[error_log] = /var/log/php-fpm/www-error.log

( log file should be writeable user name mention in www.conf file . default username mentioned is apache )

thanks for the reply. I am more so looking to tail -f one log file and get both httpd and php entries like in my RHEL7 box. I figure if I was not using php-fpm in Rocky, Rocky would then do that.

RHEL8 moved from mod_php to php-fpm. With mod_php, it was normal to have php and httpd using the same log file, because php was running in the httpd process.
Now with php-fpm, it’s normal to have a separate log file, because php-fpm is running in it’s own process.

@gerry666uk thanks for the explanation.

1 Like