How to clear cache on Mautic 3 on shared server

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

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

3 Likes

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…

1 Like

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…

1 Like

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

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

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.


In this particular example pwd is your friend.
2 Likes

Thanks Joey,

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

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 ?

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

1 Like

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

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

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!

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/*

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. :frowning: Maybe something in the configuration changed. I’ll have to do some digging.

Thank you.

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

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