Question

Group / Owner And Updating Wordpress Plugins

  • Posted December 6, 2014

I’m having trouble getting a specific plugin (All In One Event Calender, by Time.ly) to update (all others work fine), and I think the difference is that this plugin requires the ability to write, as it has a cache directory.

I followed a tutorial when I first set up my VPS that had me create a wp-user account, which operates everything in my Wordpress installation. It’s how wordpress updates via ssh, and that seems to work fine. However, my server uses the account www-data to write / execute php (that’s my understanding at least), I tried setting www-data as the group / owner for the plugin directory (and just the cache directory in a separate test), and I can’t get it to update. I can get it to install (requires the group / owner is www-data), but not update.

What combination of group / owner do I need to get a plugin that needs to write to a cache directory to be able to perform automatic updates (done by the user wp-user)?

Subscribe
Share

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

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.

the rule-of-thumb with network security: only give permissions that are needed.

in other words, err on the side of not enough permissions rather than the other way around.

your WordPress user is something different than the linux user (www-data)

www-data user AND group so that you can set your user you use for SSH to be a member of www-data group.

the plugins are ran by Wordpress, which is ran by Apache or Nginx, which is ran by the user www-data

so if you set your Wordpress installation to 774 permissions like so:

sudo chmod -R 774 /var/www/yourwordpressfolder

and then set the owner and group as www-data:

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

that should do the trick. When you use SSH to upload files, or install plugins, those files are set as owned by the user you are logged in with SSH… so that could be what was causing the issue.

Hello Porter,

I am new to digitalocean and behind the reason for choosing / hosting wordpress website at digitalocean is the cost effective. Thus I just create the droplet and install the wordpress website following this article -

https://www.digitalocean.com/community/tutorials/how-to-install-wordpress-with-lemp-on-ubuntu-16-04

And after 1-2 weeks, got a message that update Yoast Plugin and When I clicked over the update plugin button just received the error looking like unable to create / update directory. because of my mistake i.e. not following the wordpress installation procedure properly.

Then I just start looking for the solution. Then I found that there are various solution like You can follow chmod command or simply using FileZilla or CPanel.

If you are on Digitalocean can do commands step then follow -

chmod -R 775 /var/www/html/(Your WordPress Directory > WP-Content > Plugin and Theme)

You’re done,

Still, if you are facing the same problem then just follow the procedure given here -

https://tellmehost.com/fix-wordpress-file-permission-plugin-theme/

One last issue related to this. While I can now update plugins, and they work great, I can no longer SFTP through Filezilla to those directories with owner / group of www-data. As is, I have to change the group and owner, upload the file, then change it back, which is far from optimal. The particular file I’m trying to edit is contained within a plugin (needs to be altered to turn debugging on).

This comment has been deleted

I did a bit more reading, and it seems like your response is either dead on, or on the right track. Two questions:

Why 774 instead of 775? Everything I’m seeing that’s similar is 775.

Secondly, should I be setting group AND owner to www-data, or just one or the other? If both are www-data, what’s the point of the wp-user account?