wordpress logo

WordPress FTP Permission Issue

I came across an issue with wordpress a couple of years ago that I never really paid much attention to until today. Every time I try to update WordPress or update a plugin (or install a new plugin) I get the following dialog asking for my ftp credentials.

ftp

I develop primarily on a MacBook Pro running ‘Mountain Lion’ and sometimes on my HP Laptop running Ubuntu 12.04 ‘Precise Pangolin’. When I setup my dev environment on the Mac I installed everything from the command line. I didn’t want to depend on MAMP or any other LAMP stack. Not that I don’t like them but because I really want to be able to develop from the root level of my computer(s). And because I’ve yet to find a stack that includes Ruby let alone one that uses Apache as a web server.

Needless to say, there is more to learn when developing from the command line. I found out from a post on StackExchange that when installing wordpress (I’m sure this can apply to many things) proper permissions need to be set at the root of your WordPress site to avoid the above ftp issue.

In short the following bit of code should solve the issue. Replace ‘wordpress’ with the name you gave your WordPress folder at installation.

$ cd /Path/To/SitesFolder
$ sudo chown -R _www wordpress
$ sudo chmod -R g+w wordpress

Update: March 30, 2014

I just ran into the same issue on Ubuntu 12.04 and a tiny modification needs to be made to line 2 of the code above. Instead of using _www I used www-data with the same success. I should have tested this on Ubuntu before I initially posted this solution.

$ cd /Path/To/SitesFolder
$ sudo chown -R www-data wordpress
$ sudo chmod -R g+w wordpress

Leave a Reply