I have a setup of php-fpm on CentOS 7 with each user having their own pool and log files. I want to make sure that each user is able to view their own log files.
This works great for the PHP error_log, which gets created with the same user/group owner as the php-fpm pool processes are running as.
Unfortunately, the PHP slowlog for each pool is created as 'root' with '600' permissions. Is there any way to configure php-fpm to create the slowlog file with the correct file owner and/or with configurable file permissions?
The following configuration:
user = some_user group = some_group php_admin_value[error_log] = path-to-logs/php-error.log php_admin_flag[log_errors] = on request_slowlog_timeout = 10s slowlog = path-to-logs/php-slow.log Results in the following file permissions in path-to-logs:
-rw-r--r-- 1 some_user some_group 7244 Mar 10 22:54 php-error.log -rw------- 1 root root 2307 Mar 9 20:21 php-slow.log