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?

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

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, privacy policy and cookie policy

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