Possible permission issue: Nginx can't write to /var/www/html
robocopklaus opened this issue · 2 comments
I'm submitting a...
- bug report
- feature request
- support request => Please do not submit support request here, see note at the top of this template.
What is the current behavior?
I can't upload an an asset / plugin / theme since the upload folder is not writeable.
If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem via https://asciinema.org/
- Go to the backend
- Go to Media
- Upload an image
What is the expected behavior?
Assets can be uploaded and are stored correctly.
Please tell me about your environment:
OS: OSX, Linux
Other information
It might help to set the owner of /var/www/html to www-data so nginx can write files.
Something like:
RUN set -ex; \ chown -R www-data:www-data /var/www
I can't reproduce this issue locally with a fresh install. After finishing the WordPress install I had no trouble uploading a .png file through the admin back end despite the webroot being owned by root:
$ docker exec dockpress_app_1 ls -lah /var/www/html/web/app/uploads/2018/01 19:29:35
total 164K
drwxr-xr-x 8 root root 256 Jan 9 03:16 .
drwxr-xr-x 3 root root 96 Jan 9 03:15 ..
-rw-r--r-- 1 root root 6.0K Jan 9 03:15 keyboard-layout-100x100.png
-rw-r--r-- 1 root root 11K Jan 9 03:15 keyboard-layout-150x150.png
-rw-r--r-- 1 root root 16K Jan 9 03:15 keyboard-layout-300x103.png
-rw-r--r-- 1 root root 55K Jan 9 03:15 keyboard-layout-768x263.png
-rw-r--r-- 1 root root 21K Jan 9 03:15 keyboard-layout.png
What you suggested in your additional information sounds applicable, could you test the change in your environment to verify it resolves the permissions issue? If that fixes the issue it sounds like a great contribution, I'm always keen on receiving PRs. 😀
Thanks for your quick response, @joepurdy. I ran into a permission issue on the host machine. Your image had nothing to with it. Sorry for the hasty github issue 😣. You can close this issue