Ask Your Question
2

php-fpm alwayes owned by root

asked 2018-09-27 16:44:46 -0600

EmiTis Yousefi gravatar image

I'm trying to use Nginx on fedora but accessing any php file will cause 502 error because Nginx cannot access the socket file of the php-fpm. I've modified the user, group, owner.user, and owner.group in the config of php-fpm. I've tried changing the owner by chown command but after the next reset, the problem is back. After any reload or restart of the php-fpm service, the /run/php-fpm/www.sock file and the /run/php-fpm folder will by owned by the root user.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2018-09-28 02:33:59 -0600

remi gravatar image

The socket permissions are managed per ACLS:

listen.acl_users = apache,nginx

So:

# getfacl /run/php-fpm/www.sock 
# file: run/php-fpm/www.sock
# owner: root
# group: root
user::rw-
user:apache:rw-
user:nginx:rw-
group::rw-
mask::rw-
other::---

So, with default configuration, nginx is allowed to use the socket.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2018-09-27 16:44:46 -0600

Seen: 55 times

Last updated: Sep 28 '18