permissions userphotos "an unknown error occurred" 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?
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