# How to clear cache on Mautic 3 on shared server

**URL:** <https://forum.mautic.org/t/how-to-clear-cache-on-mautic-3-on-shared-server/15887>\
**Category:** Mautic 3 - Install/Upgrade Support\
**Created:** [August 31, 2020, 2:39pm UTC](https://forum.mautic.org/t/how-to-clear-cache-on-mautic-3-on-shared-server/15887 "2020-08-31T14:39:48Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![javigdiaz](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/javigdiaz/32/680_2.png) [@javigdiaz](https://forum.mautic.org/u/javigdiaz)\
**Post date:** [August 31, 2020, 2:39pm UTC](https://forum.mautic.org/t/how-to-clear-cache-on-mautic-3-on-shared-server/15887/1 "2020-08-31T14:39:48Z")

</div>

**Your software** : Mautic 3.0.2  
_My PHP version is_ : 7.3.21  
_My MySQL/MariaDB version is_ (delete as applicable): MySQLlite 3.28.0

_My problem is_ :  
I have installed plugins but don’t appear on the extension screen, so I deteled all the content of the CACHE folder placed in mautic/var/cache ( I’m using mautic 3)

_Steps I have tried to fix the problem_ :

When i deleted the whole content in the cache folder inside the VAR I practically got my mautic 3 broken and cant re-login, regardless of how many times i refresh my login page.

But as soon as i restored the the deleted CACHE folder inside the Cache folder my mautic instance becomes accessible.

I have read some solutions using sudo, the problem is that I’m running on a shared server so I don’t have access to command line .

Any suggestion?  
Javier

---

<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 31, 2020, 3:04pm UTC](https://forum.mautic.org/t/how-to-clear-cache-on-mautic-3-on-shared-server/15887/2 "2020-08-31T15:04:48Z")

</div>

Do you have ssh access, right?  
Try this:  
sudo -u [YOURUSERONTHESERVER] php /var/www/html/mautic/bin/console cache:clear

Make sure its the right path…

I run it under www-data, so mine would be:  
sudo -u www-data php /var/www/html/mautic/bin/console cache:clear

On a shared server I run everything under joeyk, so its:  
sudo -u joeyk php /var/www/html/mautic/bin/console cache:clear

The problem is, that sometimes you log in as root, and try to run everything as root. If you rebuild the cache as root, it will be not cool.

Good luck  
J

---

<div class="post-metadata">

**Author:** ![gary.harrison](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/gary.harrison/32/2864_2.png) [@gary.harrison](https://forum.mautic.org/u/gary.harrison)\
**Post date:** [September 2, 2020, 7:58pm UTC](https://forum.mautic.org/t/how-to-clear-cache-on-mautic-3-on-shared-server/15887/3 "2020-09-02T19:58:11Z")

</div>

This works for us in m3 when we need to clear the cache when installing a new plugin…

php bin/console cache:clear --env=prod

Note that it can take a few minutes to run…

---

<div class="post-metadata">

**Author:** ![joy](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/joy/32/2723_2.png) [@joy](https://forum.mautic.org/u/joy)\
**Post date:** [September 4, 2020, 11:22am UTC](https://forum.mautic.org/t/how-to-clear-cache-on-mautic-3-on-shared-server/15887/4 "2020-09-04T11:22:15Z")

</div>

when i run cache:clear command i receive this error, is it normal?

> / Clearing the cache for the prod environment with debug  
> // false
> 
> PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 495616 bytes) in /var/www/vhosts/xxxxxx/httpdocs/vendor/symfony/translation/Translator.php on line 318
> 
> In Translator.php line 318:
> 
> Error: Allowed m…

---

<div class="post-metadata">

**Author:** ![xuzo](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/xuzo/32/3396_2.png) [@xuzo](https://forum.mautic.org/u/xuzo)\
**Post date:** [October 6, 2020, 5:28am UTC](https://forum.mautic.org/t/how-to-clear-cache-on-mautic-3-on-shared-server/15887/5 "2020-10-06T05:28:51Z")

</div>

I have a Google Cloud deploy instance, is that that right path for me?

`/var/www/html/mautic/var/cache`

 ![2020-10-06 12_28_19-Cloud Deploy - sftp___rsa-key-20200928@35.233.141.211 - FileZilla](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/0/0a6861979de2329268218b87c4dd4c7c9e87f21d.png)

---

<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:** [October 6, 2020, 6:41am UTC](https://forum.mautic.org/t/how-to-clear-cache-on-mautic-3-on-shared-server/15887/6 "2020-10-06T06:41:50Z")

</div>

Short answer: yes.

Long answer:  
If you want to admin your own VPS, you will need to look under the hood.  
You can do that with getting familiar with basic ssh commands.

> **[17 Basic SSH Commands that You Should Know About](https://www.hostinger.com/tutorials/ssh/basic-ssh-commands)**
>
> Learn how to navigate and work with files in a Linux environment. We'll provide a list of basic SSH commands and examples on how to use them.

  
In this particular example pwd is your friend.

---

<div class="post-metadata">

**Author:** ![xuzo](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/xuzo/32/3396_2.png) [@xuzo](https://forum.mautic.org/u/xuzo)\
**Post date:** [October 6, 2020, 7:51am UTC](https://forum.mautic.org/t/how-to-clear-cache-on-mautic-3-on-shared-server/15887/7 "2020-10-06T07:51:00Z")

</div>

Thanks Joey,

Will have a look this evening, I’m using it now, learning nano

---

<div class="post-metadata">

**Author:** ![karthik](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/karthik/32/1129_2.png) [@karthik](https://forum.mautic.org/u/karthik)\
**Post date:** [October 7, 2020, 9:43am UTC](https://forum.mautic.org/t/how-to-clear-cache-on-mautic-3-on-shared-server/15887/8 "2020-10-07T09:43:43Z")

</div>

Hi,

I am new to Mautic, I am just trying to install and set it up. I am facing some issue in the Plugin Section.

I am also using a Shared Server. I cleared the cache folder from /www/mautic/mautic31/var/cache folder and clicked the Install plugins but no result. I still face the same problem.

Mautic Community Edition - v3.1.0 - Plugins are not Visible in the Plugin menu.  
Even in the installed mautic plugins, unable to find the Zoho CRM Plugin, from where can I download Zoho CRM Plugin.

Can you please let us know the steps to resolve this and also the link to download the Zoho CRM plugin ?

 ![MauticPluginScreen](https://us1.discourse-cdn.com/flex020/uploads/mautic/original/2X/b/bb5f0407536ce064a22d21a4ce1bc81b3843c939.png)

Mautic version - v3.1.0  
PHP version - 7.2  
Browser - Google Chrome / Firefox|

---

<div class="post-metadata">

**Author:** ![cadonovan](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/cadonovan/32/3753_2.png) [@cadonovan](https://forum.mautic.org/u/cadonovan)\
**Post date:** [October 25, 2020, 5:36pm UTC](https://forum.mautic.org/t/how-to-clear-cache-on-mautic-3-on-shared-server/15887/9 "2020-10-25T17:36:51Z")

</div>

I have the same issue - plugins not showing. Pressing reload does not work. Fresh install v 3.1.1. PHP version 7.2.33, mySQL version 5.7.34, apache version 2.4.46.

The install script is by Softaculous. On install, it wrote the wrong mySQL version (5.5) in the config.php file in the Bundles/corebundle folder (line 1124). I corrected it and then I cleared the cache (note that you need to update your documentation as it does not list the correct location of the cache - now in the var folder, not the apps folder!). Still not working.

This same error seems to have been reported several times and still there is no fix.

Please help.

Craig

UPDATE \_ FIXED.  
I found that I had to also amend the mySQL version from 5.5 to my real version (5.7.34) in the app/comfig/local.php file on line 36…

However, this error should not have occurred in the first place…

Cheers

Craig

---

<div class="post-metadata">

**Author:** ![steventhomas](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/steventhomas/32/3883_2.png) [@steventhomas](https://forum.mautic.org/u/steventhomas)\
**Post date:** [November 11, 2020, 7:25pm UTC](https://forum.mautic.org/t/how-to-clear-cache-on-mautic-3-on-shared-server/15887/10 "2020-11-11T19:25:00Z")

</div>

I found a lot of useful information for me as a beginner, thanks for sharing!

---

<div class="post-metadata">

**Author:** ![hhjchen](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/hhjchen/32/2326_2.png) [@hhjchen](https://forum.mautic.org/u/hhjchen)\
**Post date:** [June 23, 2021, 10:11am UTC](https://forum.mautic.org/t/how-to-clear-cache-on-mautic-3-on-shared-server/15887/11 "2021-06-23T10:11:23Z")

</div>

Software: Mautic 3.3.3  
PHP: 7.3.28  
MySQL: MariaDB 10.5.10

I ran sudo -u www-data php /var/www/html/mautic/bin/console cache:clear to clear the cache but then it looks like it killed Mautic. I figured since it’s already dead, I also tried rm -rf mautic/var/cache/\*. Didn’t look like it did anything. Nothing comes up when I go to the server now. Just says the site can’t be reached.

Also, tried updating Mautic thinking maybe it might restore some accidentally deleted files. I think that brought back the /prod folder in /cache.

Any other troubleshooting tips to see why I can’t access Mautic from the browser anymore?

Is there such a thing as a force “restart” of Mautic?

Or how do I restore the cache like @javigdiaz mentioned without being able to access Mautic from the browser?

Thanks!

---

<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:** [June 23, 2021, 1:06pm UTC](https://forum.mautic.org/t/how-to-clear-cache-on-mautic-3-on-shared-server/15887/12 "2021-06-23T13:06:04Z")

</div>

Hi,  
What happens if you run these?

sudo chown -R www-data:www-data /var/www/html/mautic/  
sudo chmod -R 755 /var/www/html/mautic/  
Then  
sudo -u www-data php /var/www/html/mautic/bin/console cache:clear

BTW  
rm -rf mautic/var/cache/\* only works if you are in the right folder.  
Your friend is rm -rf /var/www/html/mautic/var/cache/\*

---

<div class="post-metadata">

**Author:** ![hhjchen](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/hhjchen/32/2326_2.png) [@hhjchen](https://forum.mautic.org/u/hhjchen)\
**Post date:** [June 24, 2021, 4:13am UTC](https://forum.mautic.org/t/how-to-clear-cache-on-mautic-3-on-shared-server/15887/13 "2021-06-24T04:13:19Z")

</div>

Thank you, @joeyk.

Yes, I used the full path to mautic for the rm -rf command.

I tried your suggestion:

> sudo chown -R www-data:www-data /var/www/html/mautic/  
> sudo chmod -R 755 /var/www/html/mautic/  
> Then  
> sudo -u www-data php /var/www/html/mautic/bin/console cache:clear

but still couldn’t access the Mautic instance. ☹ Maybe something in the configuration changed. I’ll have to do some digging.

Thank you.

---

<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:** [June 24, 2021, 1:48pm UTC](https://forum.mautic.org/t/how-to-clear-cache-on-mautic-3-on-shared-server/15887/14 "2021-06-24T13:48:34Z")

</div>

What is the response after vlearing the cache?  
Nice green script or evil red one?

---

<div class="post-metadata">

**Author:** ![hhjchen](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/hhjchen/32/2326_2.png) [@hhjchen](https://forum.mautic.org/u/hhjchen)\
**Post date:** [June 25, 2021, 6:01am UTC](https://forum.mautic.org/t/how-to-clear-cache-on-mautic-3-on-shared-server/15887/15 "2021-06-25T06:01:01Z")

</div>

It was a nice green successful confirmation of the cleared cache.
