Symptoms
-
Website hosted in Plesk or some sections are inaccessible with the following error in /var/www/vhosts/example.com/logs/error_log):
AH01071: Got error 'PHP message: PHP Warning: require(/var/www/vhosts/example.com/httpdocs/wp-includes/load.php): failed to open stream: Permission denied in /var/www/vhosts/example.com/httpdocs/wp-settings.php on line 19
PHP message: PHP Fatal error: require(): Failed opening required '/var/www/vhosts/example.com/httpdocs/wp-includes/load.php' (include_path='.:/opt/plesk/php/7.1/share/pear') in /var/www/vhosts/example.com/httpdocs/wp-settings.php on line 19'
[crit] [client 203.0.113.2] (13)Permission denied: /var/www/vhosts/example.com/httpdocs/css/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable, referer: http://www.example.com/index.html
Note: the path in bold may differ.
Cause
Incorrect permissions/ownership for website files/directories:
Resolution
- Login to Plesk
- Go to Subscriptions > example.com and determine the system user for the subscription:
-
Connect to the server using SSH.
-
Run the following commands:
Note: Replace "johndoe" with the system user name from step #2
# find /var/www/vhosts/example.com/httpdocs/ -type f -exec chmod 644 {} ;
# find /var/www/vhosts/example.com/httpdocs/ -type d -exec chmod 755 {} ;
# find /var/www/vhosts/example.com/httpdocs/ -type f -exec chown johndoe:psacln {} ;
# find /var/www/vhosts/example.com/httpdocs/ -type d -exec chown johndoe:psacln {} ;