0

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?

peterh
  • 5,017

1 Answers1

-1

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!