Symptoms
-
WordPress > example.com > Copy Data fails with the following error:
PLESK_ERROR: Permission denied
-
The following error message appears in the log file
/var/log/plesk/panel.log
:ERR [panel] Task failed: id=1530, pid=17810, type=ext-wp-toolkit-taskmanage, error=Execution copy has failed with exit code 23, stdout: Sync content of '/var/www/vhosts/example.com/httpdocs' (target) owned by 'user' with '/var/www/vhosts/example.com/staging1.example.com/file1.txt' (source) owned by 'user', stderr: rsync: recv_generator: mkdir "/var/www/vhosts/example.com/httpdocs/dir1" failed: Permission denied (13)
Cause
Incorrect permissions/ownership of WordPress files and folders.
For proper operation, all files should have 644 permissions on files and 755 on folders. The subscription’s system user should be the owner of all files and folders.
Resolution
Set correct permissions/ownership on files and folders with incorrect permissions:
Note: If you are a domain owner, contact your service provider for assistance.
-
Connect to a Plesk server via SSH.
-
Set correct permissions on all files and folders. In the command below, replace example.com/httpdocs with an actual path to a WordPress installation:
Warning: All previously set custom permissions will be overwritten.
# find /var/www/vhosts/example.com/httpdocs -type f -exec chmod 644 {} ;
# find /var/www/vhosts/example.com/httpdocs -type d -exec chmod 755 {} ; -
Set the correct system user on all affected files and folders. Replace example.com with the domain name:
# INFO=($(MYSQL_PWD=`cat /etc/psa/.psa.shadow` mysql -uadmin psa -sN -e’SELECT h.www_root,s.login FROM domains d, hosting h, sys_users s WHERE s.id=h.sys_user_id AND h.dom_id=d.id AND d.name=”example.com“‘)); chown -R ${INFO[1]}:psacln ${INFO[0]}; chown ${INFO[1]}:psaserv ${INFO[0]}