Plesk: WordPress Permissions

I use WordPress on Plesk to host client sites.

On some of my client WordPress sites I started to run in to an issue when trying to update plugins, install themes, or modify files. The root cause was the permissions issue with WordPress when Plesk installed the application.

If you’re encountering permission errors on a Plesk installation of WordPress you’ll likely see a message like:

Could not create directory

There are two ways you can fix this. The first is the easiest, so I’ve always tried this first but for some installations it just doesn’t seem to get WordPress to play nicely.

First, log in to your Plesk installation via SSH.

ssh user@127.0.0.1

Where “user” is your username, or the root user and “127.0.0.1” is the IP address of your server. If you’re not using SSH keys you’ll be prompted for your password (enter that now if needed).

Next, you’ll want to run the prepackaged command that comes with Plesk and works for versions 11.5, 12, and 12.5.

/usr/local/psa/bin/repair --restore-vhosts-permissions

If you’ve entered this correctly you will see a message confirming that the permission have been reset. Return to WordPress, and try test to make sure it’s working. This will generally solve most issues, if you still get errors when modifying files you can then try manually adjusting the permission for WordPress inside of your Plesk installation.

Transfer back to your command line, or log in via SSH if you’re not still connected.

Now, you’ll need to navigate to your site folder.

cd /var/www/vhosts/your-site-name.com/

Then modify the permissions:

chown -R youruser:psacln httpdocs
chmod -R g+w httpdocs/wp-content
find httpdocs -type d -exec chmod g+s {} \;

Note that “your-site-name.com” and “youruser” must be replaced with the proper variables for your installation. Additionally, “youruser” is the user for this particular WordPress installation and not the SSH user that was used to log in to your Plesk server, though in some cases it may be the same (if you’re hosting for clients, it generally it isn’t).

I’ve still not found out why neither of these commands works 100% of the time, but between the two of them I’ve not been able to “not” solve a WordPress permissions issue using Plesk Onyx.

Leave a Reply

Your email address will not be published. Required fields are marked *