# Restore File Permissions

**URL:** <https://forum.mautic.org/t/restore-file-permissions/1898>\
**Category:** Product Support\
**Created:** [June 1, 2015, 6:52pm UTC](https://forum.mautic.org/t/restore-file-permissions/1898 "2015-06-01T18:52:56Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![petertl](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/petertl/32/511_2.png) [@petertl](https://forum.mautic.org/u/petertl)\
**Post date:** [June 1, 2015, 6:52pm UTC](https://forum.mautic.org/t/restore-file-permissions/1898/1 "2015-06-01T18:52:56Z")

</div>

Hello,  
  
  
  
Is there any way (e.g. a bash script) to restore all file permissions?  
  
  
  
Thank you,  
  
  
  
Peter

---

<div class="post-metadata">

**Author:** ![petertl](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/petertl/32/511_2.png) [@petertl](https://forum.mautic.org/u/petertl)\
**Post date:** [June 1, 2015, 6:52pm UTC](https://forum.mautic.org/t/restore-file-permissions/1898/2 "2015-06-01T18:52:56Z")

</div>

Hello,

Is there any way (e.g. a bash script) to restore all file permissions?

Thank you,

Peter

---

<div class="post-metadata">

**Author:** ![chad.windnagle](https://avatars.discourse-cdn.com/v4/letter/c/7feea3/32.png) [@chad.windnagle](https://forum.mautic.org/u/chad.windnagle)\
**Post date:** [June 2, 2015, 4:39pm UTC](https://forum.mautic.org/t/restore-file-permissions/1898/3 "2015-06-02T16:39:04Z")

</div>

Hi PeterTL

There’s CLI functions you can use to do this, but it’s pretty native to Linux, and its also going to be slightly custom to your particular environment configuration as well. The ‘rule’ here should be 0755 for folders, 0644 for files. More on that here: [https://forums.cpanel.net/threads/why-are-644-and-755-unix-permissions-ideal-for-files-directories-in-public-folders.136821/](https://forums.cpanel.net/threads/why-are-644-and-755-unix-permissions-ideal-for-files-directories-in-public-folders.136821/)

It’s a fairly common configuration for most web applications. To set it from the command line in case you messed it up, you can use something like this:

[http://superuser.com/questions/91935/how-to-chmod-all-directories-except-files-recursively](http://superuser.com/questions/91935/how-to-chmod-all-directories-except-files-recursively).

In general, this is all standard linux config stuff, nothing really applies to Mautic uniquely.

---

<div class="post-metadata">

**Author:** ![petertl](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/petertl/32/511_2.png) [@petertl](https://forum.mautic.org/u/petertl)\
**Post date:** [June 2, 2015, 5:42pm UTC](https://forum.mautic.org/t/restore-file-permissions/1898/4 "2015-06-02T17:42:46Z")

</div>

Thanks for your reply. I assumed Mautic needs some special attributes for some folders. If this is not the case, I will do it you suggested.

Peter

---

<div class="post-metadata">

**Author:** ![chad.windnagle](https://avatars.discourse-cdn.com/v4/letter/c/7feea3/32.png) [@chad.windnagle](https://forum.mautic.org/u/chad.windnagle)\
**Post date:** [June 2, 2015, 8:45pm UTC](https://forum.mautic.org/t/restore-file-permissions/1898/5 "2015-06-02T20:45:54Z")

</div>

If you are using a web server that runs php as the apache web server user (eg: fastCGI mode) then PHP runs as the user, and can write to all the folders / files as the owner.

If you aren’t doing that, then PHP will need to write to the app/cache and app/logging folders. You may need to make those publicly writable (777). This is generally not recommended but is necessary with some hosts.

---

<div class="post-metadata">

**Author:** ![silavapi](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/silavapi/32/7424_2.png) [@silavapi](https://forum.mautic.org/u/silavapi)\
**Post date:** [February 2, 2020, 10:59pm UTC](https://forum.mautic.org/t/restore-file-permissions/1898/6 "2020-02-02T22:59:48Z")

</div>


