Symptoms
-
PHP-FPM
handler is set in Domains > example.com > PHP Settings for a website and it is not accessible with the following error:502 Bad Gateway
503
Service Temporarily Unavailable
The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later. -
The following error is in
/etc/apache2/logs/error_log
or in/var/www/vhosts/example.com/logs/error_log
:(13)Permission denied: AH02454: FCGI: attempt to connect to Unix domain socket /var/www/vhosts/system/example.com/php-fpm.sock (127.0.0.1) failed
-
Socket file has incorrect permissions (it should be
0660
):# getfacl /var/www/vhosts/system/example.com/php-fpm.sockgetfacl: Removing leading ‘/’ from absolute path names
file: var/www/vhosts/system/example.com/php-fpm.sock
owner: root
group: psaserv
user::rw-
group::—
other::—
Cause
Extended ACL rules are set for /var/www/vhosts/system/
directory and subdirectories, which overwrite correct permissions.
Resolution
-
Connect to the server via SSH;
-
Disable extended ACL rules for
/var/www/vhosts/system/
directory# setfacl -Rb /var/www/vhosts/system/
If it did not fix the issue, try changing PHP version for the domain:
- Log into Plesk;
- Go to Domains > example.com > PHP Settings.