Delete Cache And Site is offline

Your software
My Mautic version is:4
My PHP version is:8.1
My Database type and version is: Ubuntu 20.4

Your problem
My problem is: Delete Cache And Site is offline.

These errors are showing in the log: The site is currently offline due to encountering an error. If the problem persists, please contact the system administrator.

System administrators, check server logs for errors.

Steps I have tried to fix the problem:

Hello there,

First of all, I think this is my fault.

Cache folder was located in public_html/mautic/var

As I try to fix the setting “Configuration section” can not open and can not Import my list to Mautic. So
I follow one of the YouTuber but did not realize that was in 2016.

The site is totally offline.

Do I have to re-install?

Regards,
Jin

In mautic/var/logs you should have log files what do the logs from today say?

Hey mzagmajster,

I deleted it today but The latest log is 2021/09/21

[2021-09-21 08:55:32] mautic.NOTICE: PHP Notice - SessionHandler::gc(): ps_files_cleanup_dir: opendir(/var/lib/php/sessions) failed: Permission denied (13) - in file /home/mecandid/domains/mautic.mecandid.com/public_html/vendor/symfony/http-foundation/Session/Storage/Handler/StrictSessionHandler.php - at line 106 {“maxlifetime”:1440}

Did you delete cache folder or just its contents? If you deleted the cache folder create ti again and make sure you give it the right permissions and user & group.

Only deleted the folder. I try to create the folder but can’t do it directly on the file. Sorry, I am not sure where and how to go to give permissions, is there any guideline I can find?

Folder mautic/var/cache must exists so make sure you create it.

I do not know about the guide. If you are running Linux OS look into commands: mkdir, chown & chmod.

And in the future you should delete only the contents of mautic/var/cache, so something like:

rm -rf var/cache/prod/* – That deletes your production cache (this is probably what you are using).

rm -rf var/cache/dev/* - That deletes the cache if you run your instance in development mode.

You also have command php bin/console cache:clear but I find out the above commands are the most reliable.

Hey mzagmajster, Thank you so much. I will look into it!

I managed to create a folder and gave permission but the site is still offline. What do I have to do? Thank you

Hi, I do not have much to go on here. If you want, I can look into your installation and try to figure out what went wrong. Shoot me PM if you are up for it.

Hey mzagmajster, appreciated that. I will re-install it. Thank you for your reply here.

have you run chown on the entire mautic directory ?
Did you install any new plugins ?

Hey mikew,
The files are not showing after I extracted Mautic zip in Virtualmin. Still searching for how to fix this.