Centos 7, Plesk 12
Problem:
PHP-FPM support for nginx will not start when attempted in Tools & Settings > Services Management
Check error log:
#tail /var/log/php-fpm/error.log
ERROR: unable to bind listening socket for address '/var/www/vhosts/system/domain.tld/php-fpm.sock': Permission denied (13)
Possible problem:
SELinux may be preventing it. To test this do:
#setenforce 0
Now try and start PHP-FPM support again in Tools & Settings > Services Management
If that now starts you know what the problem is. Go to "Fix" below
If it didnt work, you have a different issue. Turn SELinux back on while you figure it out:
#setenforce 1
Fix:
The following worked for me but i know very little about SELinux - corrections welcome:
## Turn SELinux to permissive
# setenforce 0
## In Plesk panel start PHP-FPM support in Tools & Settings > Services Management
# grep php-fpm /var/log/audit/audit.log | audit2allow -m php-fpmlocal > php-fpm.te
## You can vi/cat/nano php-fpm.te and see the custom policy that will be created. When done, execute it with:
# grep php-fpm /var/log/audit/audit.log | audit2allow -M php-fpmlocal
## now load the policy
# semodule -i php-fpmlocal.pp
## Turn SElinux back on
#setenforce 1
## In Plesk panel start PHP-FPM support in Tools & Settings > Services Management
## Still not working. Sorry - good luck finding the problem.
Reference page
http://wiki.centos.org/HowTos/SELinux
Problem:
PHP-FPM support for nginx will not start when attempted in Tools & Settings > Services Management
Check error log:
#tail /var/log/php-fpm/error.log
ERROR: unable to bind listening socket for address '/var/www/vhosts/system/domain.tld/php-fpm.sock': Permission denied (13)
Possible problem:
SELinux may be preventing it. To test this do:
#setenforce 0
Now try and start PHP-FPM support again in Tools & Settings > Services Management
If that now starts you know what the problem is. Go to "Fix" below
If it didnt work, you have a different issue. Turn SELinux back on while you figure it out:
#setenforce 1
Fix:
The following worked for me but i know very little about SELinux - corrections welcome:
## Turn SELinux to permissive
# setenforce 0
## In Plesk panel start PHP-FPM support in Tools & Settings > Services Management
# grep php-fpm /var/log/audit/audit.log | audit2allow -m php-fpmlocal > php-fpm.te
## You can vi/cat/nano php-fpm.te and see the custom policy that will be created. When done, execute it with:
# grep php-fpm /var/log/audit/audit.log | audit2allow -M php-fpmlocal
## now load the policy
# semodule -i php-fpmlocal.pp
## Turn SElinux back on
#setenforce 1
## In Plesk panel start PHP-FPM support in Tools & Settings > Services Management
## Still not working. Sorry - good luck finding the problem.
Reference page
http://wiki.centos.org/HowTos/SELinux