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 2

chmod 644 /var/log/php-fpm.log
  • 9
    Indeed, that works on an existing log file and is persistent across FPM restarts and server reboots. But if the file is being created for the first time (or if I delete it for some reason, say) the default permission on the new file is still 600. Is there any way to ensure 644 like for other programs' log files?
    – Rohit
    Mar 2, 2013 at 15:01

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.