virtous
By:
virtous

Unix permissions with Wordpress on Ubuntu 14.04

September 3, 2015 1.1k views
Linux Basics WordPress Ubuntu

I'm trying to wrap my head around unix permissions. The problem I'm having is that Wordpress isn't able to update itself... instead it's giving me an FTP prompt. On the Wordpress website it clearly says that this is normal behavior when Wordpress doesn't have correct unix permissions setup.

So from what I understand I need to give the unix user which Wordpress operates with, correct permissions?

Running echo exec('groups') returns www-data
Running echo exec('whoami') returns www-data

But even after changing the file owner to www-data on almost every file and folder it still doesn't work.

I'm sure it's something very basic that I'm missing...

Do I need to restart some service after I changed permissions?

Any idea what I should do?

Help/guidance is appreciated!

2 Answers

Have you tried

chown -R www-data:www-data /web/directory/

I typically have this issue when I run my LEMP(nginx) stacks and the above command fixes it. The problem is the WordPress can't write to the directory. Once you do this restart Apache.

Thank you MrPeppah for getting back to me so quick.

I followed your advice and changed owner and group all files and folders to www-data.
This actually made it work, but I'm concerned about the safety here. Isn't this considered bad practice?

Have another answer? Share your knowledge.