# Clear the Cache Plugin

**URL:** <https://forum.mautic.org/t/clear-the-cache-plugin/12594>\
**Category:** 3rd Party Addons\
**Created:** [February 5, 2020, 7:34am UTC](https://forum.mautic.org/t/clear-the-cache-plugin/12594 "2020-02-05T07:34:09Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![healthstatus1](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/healthstatus1/32/961_2.png) [@healthstatus1](https://forum.mautic.org/u/healthstatus1)\
**Post date:** [February 5, 2020, 7:34am UTC](https://forum.mautic.org/t/clear-the-cache-plugin/12594/1 "2020-02-05T07:34:09Z")

</div>

I think we all agree it is not too user friendly with all the clear cache requirements just to install a new plugin, or get Mautic back on track. So we wrote a plugin to add that to the settings menu. You can get it here: [https://automauticly.com/automauticly-clear-cache-plugin/](https://automauticly.com/automauticly-clear-cache-plugin/)

---

<div class="post-metadata">

**Author:** ![nicholas](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/nicholas/32/613_2.png) [@nicholas](https://forum.mautic.org/u/nicholas)\
**Post date:** [April 29, 2020, 3:48am UTC](https://forum.mautic.org/t/clear-the-cache-plugin/12594/2 "2020-04-29T03:48:16Z")

</div>

How can I make use of this plugin with a 500 error. I cleared the cache via documentaion, but my app/cache folder won’t regenerate. Can I find a fresh cache folder somewhere, and then install your plugin? I tried to get it from github but the cache isn’t in the source code?

---

<div class="post-metadata">

**Author:** ![healthstatus1](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/healthstatus1/32/961_2.png) [@healthstatus1](https://forum.mautic.org/u/healthstatus1)\
**Post date:** [May 4, 2020, 1:01pm UTC](https://forum.mautic.org/t/clear-the-cache-plugin/12594/3 "2020-05-04T13:01:34Z")

</div>

Hi Nicholas,  
Make sure your permissions and owners on both the plugin folder and the cache folder are set correctly. On my websites that is the owner is www-data:www-data

---

<div class="post-metadata">

**Author:** ![maurice](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/maurice/32/406_2.png) [@maurice](https://forum.mautic.org/u/maurice)\
**Post date:** [June 22, 2020, 7:24pm UTC](https://forum.mautic.org/t/clear-the-cache-plugin/12594/4 "2020-06-22T19:24:39Z")

</div>

This is very useful.

Is it also compatible with Mautic v3.0.0?

---

<div class="post-metadata">

**Author:** ![dewale.michael](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/dewale.michael/32/1591_2.png) [@dewale.michael](https://forum.mautic.org/u/dewale.michael)\
**Post date:** [August 6, 2020, 11:31pm UTC](https://forum.mautic.org/t/clear-the-cache-plugin/12594/5 "2020-08-06T23:31:17Z")

</div>

@healthstatus1 appears you dont support Gautit Cache + Clearout plugins anymore. I purchased the plugin (clearout) but you or your support Email hasnt been responsive… I have sent tons emails — & no responses!

Your cachre plugin isnt compatible with mautic3, Likewise Clearout.

I just hope all is well with you.

---

<div class="post-metadata">

**Author:** ![ericgr](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/ericgr/32/5505_2.png) [@ericgr](https://forum.mautic.org/u/ericgr)\
**Post date:** [July 28, 2021, 9:27pm UTC](https://forum.mautic.org/t/clear-the-cache-plugin/12594/6 "2021-07-28T21:27:32Z")

</div>

> [@dewale.michael](#):
>
> Gautit Cach

I can verify that Gautit Cache Clear plugin does not work on 3.3.3 - Seems like either a permissions issue or missing directory (at least from the error message it provides).

---

<div class="post-metadata">

**Author:** ![nsomaru](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/nsomaru/32/2801_2.png) [@nsomaru](https://forum.mautic.org/u/nsomaru)\
**Post date:** [July 28, 2021, 10:14pm UTC](https://forum.mautic.org/t/clear-the-cache-plugin/12594/7 "2021-07-28T22:14:32Z")

</div>

Could you provide the error so that we can maybe find a fix?

---

<div class="post-metadata">

**Author:** ![healthstatus1](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/healthstatus1/32/961_2.png) [@healthstatus1](https://forum.mautic.org/u/healthstatus1)\
**Post date:** [July 29, 2021, 1:28am UTC](https://forum.mautic.org/t/clear-the-cache-plugin/12594/8 "2021-07-29T01:28:36Z")

</div>

Hi Michael,  
Last email I am showing from you is from December 30 and we responded on Jan 2.

Sorry we are not connecting, I will check and see what is going on with email.

I will send link to most current clean email plugin to the email address I have for you on account.

Greg

---

<div class="post-metadata">

**Author:** ![healthstatus1](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/healthstatus1/32/961_2.png) [@healthstatus1](https://forum.mautic.org/u/healthstatus1)\
**Post date:** [July 29, 2021, 1:28am UTC](https://forum.mautic.org/t/clear-the-cache-plugin/12594/9 "2021-07-29T01:28:55Z")

</div>

We are checking on this…

Make sure your initial permissions on the cache directory are set correctly and should be the user and group that the web server is running under. If that is the case, then the plugin should clear the cache without issue.

---

<div class="post-metadata">

**Author:** ![ericgr](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/ericgr/32/5505_2.png) [@ericgr](https://forum.mautic.org/u/ericgr)\
**Post date:** [July 29, 2021, 6:25pm UTC](https://forum.mautic.org/t/clear-the-cache-plugin/12594/10 "2021-07-29T18:25:58Z")

</div>

OK - so I added the ClearCache plugin back to my mautic instance (3.3.3). Cleared cache manually, etc. And the plugin button appears. But when I click the ‘clear cache’ button it tells me there is an error with either mission directory or permissons error.

Looking in the Mautic error log, I can see this:

`[2021-07-29 14:19:53] mautic.WARNING: PHP Warning - unlink(/var/www/html/app/../var/cache/prod/translations/catalogue.pl.gUfYNxr.php.meta): Permission denied - in file /var/www/html/plugins/GautitClearCacheBundle/Controller/DefaultController.php - at line 66 {"dir":"/var/www/html/app/../var/cache/prod/translations","objects":[ ....`

(it goes on from here for some time and for each file/folder it tried to delete)

I am including some screenshots of the command line, so you can see that the permissons on the ClearCache Plugin match the existing plugins:

 ![2021-07-29_14-15-19](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/f/f50b5ae7ef4d2a36ba40c2c41d7cba4de7ae9215.png)

However, it seems to me that the plugin is having difficulty accessing the folders that it is trying to delete. Perhaps the issue is not with permissions on the actual ClearCache plugin.

The same behavior occurred when I changed the owner and group of the ClearCache plugin to ‘root’. I don’t know enough about working in Ubuntu to know if this would make a difference, but I just thought I’d try it and add it here for some extra info.

---

<div class="post-metadata">

**Author:** ![nsomaru](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/nsomaru/32/2801_2.png) [@nsomaru](https://forum.mautic.org/u/nsomaru)\
**Post date:** [July 30, 2021, 3:14am UTC](https://forum.mautic.org/t/clear-the-cache-plugin/12594/11 "2021-07-30T03:14:32Z")

</div>

You are causing lots of issues for yourself by executing things as `root`. This is evident from the screenshot you shared with some folders being owned by `root` still.

It is extremely ill advised to run anything as `root`, let alone installing plugins into a webserver directory.

My advice would be to learn to operate using the `www-data` user (`su - www-data -s /bin/bash`). It will be far harder to mess up the perms of stuff when the right user is extracting files.

I’m not an expert on Mautic file perms so obviously I can’t comment, but changing ownership recursively on the cache directory to allow `www-data` user and group to read and write is a shotgun approach but should work

---

<div class="post-metadata">

**Author:** ![ericgr](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/ericgr/32/5505_2.png) [@ericgr](https://forum.mautic.org/u/ericgr)\
**Post date:** [July 30, 2021, 8:59pm UTC](https://forum.mautic.org/t/clear-the-cache-plugin/12594/12 "2021-07-30T20:59:33Z")

</div>

Thanks - I noticed that, as well, when I was investigating permissions. It looks like I should probably be logged in as www-data when installing these plugins (or at least changing to that owner using the code you helpfully provided).

Thanks, again, @nsomaru. I’ll probably pass on working with this plugin anymore as I’m confident of how to do it from the command line, now.

---

<div class="post-metadata">

**Author:** ![nsomaru](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/nsomaru/32/2801_2.png) [@nsomaru](https://forum.mautic.org/u/nsomaru)\
**Post date:** [July 30, 2021, 10:39pm UTC](https://forum.mautic.org/t/clear-the-cache-plugin/12594/13 "2021-07-30T22:39:30Z")

</div>

Just to note, `chown` is used to handle permissions. That’s been covered ad nauseum elsewhere.

The code I gave will drop you into a user shell for the `www-data` user. Any operations operating on files should typically be performed by this user to ensure you don’t wreck permissions by using a `root` shell. That way you would find permissions errors to be few and far between (for any plug-in or modifications you make).

---

<div class="post-metadata">

**Author:** ![Postwiser](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/postwiser/32/7021_2.png) [@Postwiser](https://forum.mautic.org/u/Postwiser)\
**Post date:** [March 17, 2022, 8:49am UTC](https://forum.mautic.org/t/clear-the-cache-plugin/12594/14 "2022-03-17T08:49:08Z")

</div>

Hey there went to you new site to download the clear cache plugin and the download is frozen
