The FPM log file located in /var/log/php-fpm.log has permissions rw------- (600). Other log files have rw-r--r--. How can I configure the file permission to 644?
2 Answers
Set the logging of PHP-FPM to syslog instead of it's own logging.
; Error log file ; If it's set to "syslog", log is sent to syslogd instead of being written ; in a local file. ; Note: the default prefix is /var ; Default Value: log/php-fpm.log
error_log = syslog
; syslog_facility is used to specify what type of program is logging the ; message. This lets syslogd specify that messages from different facilities ; will be handled differently. ; See syslog(3) for possible values (ex daemon equiv LOG_DAEMON) ; Default Value: daemon
syslog.facility = daemon
; syslog_ident is prepended to every message. If you have multiple FPM ; instances running on the same server, you can change the default value ; which must suit common needs. ; Default Value: php-fpm
syslog.ident = php-fpm
cd /var/logsudo touch php-fpm.logsudo chown correctUser:correctGroup php-fpm.logsudo chmod 644 php-fpm.log? How often are you deleting it? – Eliezer Berlin Feb 19 '23 at 10:50