I have a WordPress setup using HHVM & NGINX on Ubuntu 14.04 that can't moves files when uploaded.

Nginx is running as www-data.

Files are all owned by deploy:deploy. Where www-data is a member of deploy & deploy is a member of www-data as well.

If files are set to 777 upload works as expected. 775 is giving an error. Leads me to believe it is a permissions error.

Any idea what I've done wrong setting up groups and users?

| improve this question | | | | |

I also wrestled with this problem. Here's a basic solution to help point you in the right direction:

Step 1: find the default root folder of your web server

  • For example /var/www

Step 2: give the user www-data full ownership of web server folder. (Use -R to make change recursive.)

  • sudo chown -R www-data:www-data /path/to/webserver/root

Step 3: restart NGINX

  • sudo service nginx restart

Note: The above will solve your problem; though it exposes your server stack to number of potential vulnerabilities. Please check the links below for further info:

File Permissions

I strongly suggest you set permissions back to 755, to avoid any unnecessary security issues. Check out the Wordpress codex info on file permissions.

Linux permissions

Also, check the link below for further info on setting up users and groups. It provides a good breakdown of Linux permissions, privilege separation etc. Should cover all your needs...

You're definitely looking in the right area, the answer is much closer than you might think!

| improve this answer | | | | |
  • In principle I fully agree with you. That being said, Stewart's question is related to permissions and read/write errors with Wordpress running on NGINX. My answer shows a basic solution, but also refers to the Wordpress documentation on security; as well as a serverfault answer, that clearly explains server, group and user permissions for a secure stack running on Ubuntu or other Debian-based Linux distributions. I'll edit my answer to reflect this, thanks for pointing this out. – Perp1exed Jun 13 '15 at 4:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.