I have a server running on CENTOS 8, with Apache 4.2 and PHP-FPM.
When i restart the service PHP-FPM i get a 403 forbidden error.
This happen because the owner of /run/php-fpm/www.sock
becomes root
instead of the Apache running user.
I have tried, without success, to edit /etc/php-fpm.d/www.conf
file
; Set permissions for unix socket, if one is used. In Linux, read/write
; permissions must be set in order to allow connections from a web server.
; Default Values: user and group are set as the running user
; mode is set to 0660
listen.owner = apache
listen.group = apache
listen.mode = 0660
How i can restart PHP-FPM without changing every time the owner of the socket?
2
Answers
Got it. The issue was
listen.acl_users
.When set, listen.owner and listen.group are ignored.
Solution: comment out this line:
;listen.acl_users = apache,nginx
try to add:
listen = /path/to/unix/socket
and make sure that the service uses the right socket file.