Permission Issue with PHP-FPM

When i switch from fastcfgi to php-fpm i have permission Problem. The Nginx Error log shows me the following error:

2017/02/20 10:48:00 [crit] 12337#12337: *13 connect() to unix:/var/php-fpm/13857322603365.sock failed (13: Permission denied) while connecting to upstream,

The socket file is owned by root. I think you have to add the following lines to the fpm configuration.

listen.owner = username = username
listen.mode = 0660


The next release of Virtualmin will fix this by setting the correct permissions on that socket file.

how about name the sock file and the fpm configuration file inside pool.d directory with the virtualhost name?

I explicitly chose not to do this, as the domain name can change, but the domain ID is always constant in Virtualmin.

IMHO the problem is that is that if you need to change php-fpm configuration actually you need to modify the file so, every time, you need to identify the domain id.

Adding the possibility to change/add configuration to php-fpm pool configuration will solve this problem (see ticket

Mostafa's picture
Submitted by Mostafa on Fri, 02/24/2017 - 07:38

@Kintaro you could run grep -iR "domain" inside the php-fpm.d directory to easily find the config file instead.

You can also find the ID of a domain with a command like :

virtualmin list-domains --domain --id-only