Question

Cannot update Wordpress plugins (file permission issues)?

I get: Update Failed: The update cannot be installed because we will be unable to copy some files. This is usually due to inconsistent file permissions.

When trying to update plugins from the admin interface. I’ve set the user to www-data for both directories and files … but nothing works.

What do I have to do to simply being able to use Wordpress as it is intended?

Show comments

Submit an answer


This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

KFSys
Site Moderator
Site Moderator badge
December 2, 2020
Pinned Answer

Hello all,

This issue is usually caused by incorrect file permissions or ownerships on your server (rather than being a problem with the plugin itself). Basically, WordPress isn’t able to properly access its own plugins folder, and as a result can’t put the updated plugins files in there.

Permissions

Permissions can be set to 644 for files and 755 for folders. To do so, you can run two quick find commands.

To make all folders in your website path with 755 permissions run the following command

find /path/to/website -type d -exec chmod 755 {} \;

To make all files in your website root directory with 644 permissions, you can run

find /path/to/website -type f -exec chmod 644 {} \;

Please make sure to change /path/to/website with your real path.

Ownership

Ownership means which user and group are controlling the files. Usually, that’s www-data. So what you’ll need to do si

sudo chown -R www-data:www-data /path/to/website

Please make sure to change /path/to/website with your real path.

Once you do it, that’s it, you are good to go.

Regards, KFSys

Accepted Answer

Ran these commands, and it’s now working just fine (both dashboard and ftp).

sudo usermod -aG www-data $USER

sudo chown -R www-data:www-data /var/www

sudo chmod -R 774 /var/www

My WordPress website showing a couple of problems

  1. Plugin and theme update failed.
  2. Header slider not showing
  3. left sidebar is broken

someone help me please. here my website: https://wcblogs.com

**Thanks in advance **

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

Become a contributor for community

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

DigitalOcean Documentation

Full documentation for every DigitalOcean product.

Resources for startups and SMBs

The Wave has everything you need to know about building a business, from raising funding to marketing your product.

Get our newsletter

Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.

New accounts only. By submitting your email you agree to our Privacy Policy

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.