1

On my production server, each time I try to change or upload a user photo I get the "an unknown error occurred" message. If I check the logs, the error says it couldn't delete the folder of the userphotos because it is not writable.

Now I checked the settings and everything is set to 755, the same as the assets folder where I have no problems uploading. The only way I got the userphotos to work is to set the permission on the folder to 777, but that's not the best solution security-wise.

So why isn't the userphotos folder writeable but the assets folder is?

4
  • What user:group owns the userphotos folder and what user:group is your web server running as?
    – Brad Bell
    Commented Sep 29, 2016 at 17:05
  • userphotos folder owned by clientname:clientname and webserver as 'www-data:www-data Commented Oct 12, 2016 at 9:50
  • chown -R www-data:www-data userphotos?
    – Brad Bell
    Commented Oct 12, 2016 at 18:25
  • Yeah that did the trick. Thanks for helping out. :-) Commented Oct 13, 2016 at 11:32

1 Answer 1

0

Changing the userphotos folder's owner to be the same as the user:group Apache was running as solved the issue. i.e.

chown -R www-data:www-data userphotos

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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