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

<pre><code>chown -R www-data:www-data userphotos
</code></pre>

CC BY-SA 3.0
2016-10-13T17:48:09.740Z
2016-10-13T17:48:09.740Z
Brad Bell
<p>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.</p>

<p>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.</p>

<p>So why isn't the userphotos folder writeable but the assets folder is?</p>

CC BY-SA 3.0
2016-09-29T17:05:08.100Z
What user:group owns the `userphotos` folder and what user:group is your web server running as?
Brad Bell
CC BY-SA 3.0
2016-10-12T09:50:04.570Z
`userphotos` folder owned by `clientname:clientname` and webserver as `'www-data:www-data`
Jan Van Echelpoel
CC BY-SA 3.0
2016-10-12T18:25:00.110Z
`chown -R www-data:www-data userphotos`?
Brad Bell
CC BY-SA 3.0
2016-10-13T11:32:19.097Z
Yeah that did the trick. Thanks for helping out. :-)
Jan Van Echelpoel
<error><permissions>
permissions userphotos "an unknown error occurred"
# permissions userphotos "an unknown error occurred"

(Asked by: username_0 on 2016-09-29)

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?

**Tags:** error, permissions

> **Comments:**
> **username_1**: What user:group owns the `userphotos` folder and what user:group is your web server running as?  
> **username_0**: `userphotos` folder owned by `clientname:clientname` and webserver as `'www-data:www-data`  
> **username_1**: `chown -R www-data:www-data userphotos`?  
> **username_0**: Yeah that did the trick. Thanks for helping out. :-)  

---

## 1 answers

### Answer by username_1 on 2016-10-13. Score: 0 | Accepted answer

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


---

