# Clear cache in Mautic 3 via command line not going through

**URL:** <https://forum.mautic.org/t/clear-cache-in-mautic-3-via-command-line-not-going-through/20635>\
**Category:** Mautic 3 - Install/Upgrade Support\
**Created:** [August 30, 2021, 6:41am UTC](https://forum.mautic.org/t/clear-cache-in-mautic-3-via-command-line-not-going-through/20635 "2021-08-30T06:41:01Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![duplexcleaning](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/duplexcleaning/32/7211_2.png) [@duplexcleaning](https://forum.mautic.org/u/duplexcleaning)\
**Post date:** [August 30, 2021, 6:41am UTC](https://forum.mautic.org/t/clear-cache-in-mautic-3-via-command-line-not-going-through/20635/1 "2021-08-30T06:41:01Z")

</div>

Mautic version  
_My PHP version is_ : 7.2  
\*My MySQL version is 5.7.35

\*Processing clear cache via Command Line

_These errors are showing in the installer_ :  
Error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 32768 bytes)

_My problem is_ : Unable to clear cache in order to install Recaptcha Plugin for Mautic 3 (from [GitHub - KonstantinCodes/mautic-recaptcha: This Plugin brings reCAPTCHA integration to mautic.\</ti](https://github.com/KonstantinCodes/mautic-recaptcha))

 ![mautic-clear-cache-issue](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/b/b159672f1db253306e8525be72da6c7762fa0a98.jpeg)

_Steps I have tried to fix the problem_ :

- Clearing var/cache
- Setting memory limit to -1 in php options in cpanel

---

<div class="post-metadata">

**Author:** ![joeyk](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/joeyk/32/11164_2.png) [@joeyk](https://forum.mautic.org/u/joeyk)\
**Post date:** [August 30, 2021, 7:50am UTC](https://forum.mautic.org/t/clear-cache-in-mautic-3-via-command-line-not-going-through/20635/2 "2021-08-30T07:50:57Z")

</div>

You need to restart apache after this to make sure your setting are updated.  
J

---

<div class="post-metadata">

**Author:** ![duplexcleaning](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/duplexcleaning/32/7211_2.png) [@duplexcleaning](https://forum.mautic.org/u/duplexcleaning)\
**Post date:** [March 23, 2022, 10:33pm UTC](https://forum.mautic.org/t/clear-cache-in-mautic-3-via-command-line-not-going-through/20635/3 "2022-03-23T22:33:59Z")

</div>

thanks @joeyk

---

<div class="post-metadata">

**Author:** ![bradycargle](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/bradycargle/32/6252_2.png) [@bradycargle](https://forum.mautic.org/u/bradycargle)\
**Post date:** [March 25, 2022, 1:33pm UTC](https://forum.mautic.org/t/clear-cache-in-mautic-3-via-command-line-not-going-through/20635/4 "2022-03-25T13:33:59Z")

</div>

I have the same problem on Mautic 4, no clue what causes it. Even upping my memory requirements to crazy amounts (\>1GB) doesn’t help

I get around this by opening the index\_dev.php file instead of the index.php, since it clears cache for you. For me, that looks like localhost/mautic/index\_dev.php. I believe using something like `symfony serve` in the command line achieves the same effect, but not 100% sure

---

<div class="post-metadata">

**Author:** ![mzagmajster](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/mzagmajster/32/687_2.png) [@mzagmajster](https://forum.mautic.org/u/mzagmajster)\
**Post date:** [March 25, 2022, 2:27pm UTC](https://forum.mautic.org/t/clear-cache-in-mautic-3-via-command-line-not-going-through/20635/5 "2022-03-25T14:27:17Z")

</div>

Hi,

when I was encounter the issue in different setting, it was due to loading heavy objects into memory. I did not encounter this during the cache clear.

There were cases were cache:clear is not effective, because of this (and the error above) as workaround I would suggest clearing cache like this from Mautic root dir:

```auto
rm -rf var/cache/dev/* var/cache/prod/*

```

I suspect something, could @bradycargle run this command:

```auto
php bin/console mautic:plugins:reload --env=prod

```

and let us know if mempry error still appears? Thanks.

As far as I know running dev mode disables most cache but not all (for example Config/config.php files). So one way or the other you have to clear the cache at some point.
