Need help updating to 4.4.10 and clearing the cache for cron jobs

Your software
My Mautic version is: 4.4.9
My PHP version is: 7.4

I downloaded Mautic using Softaculous, and it seems my files don’t match the ‘path to the cache directory’ (nor the ‘path to log directory’) as written in my settings. I’m trying to clear whatever cache I need to for cron jobs, however, nothing seems to work.

I tried navigating to root folder and then to bin/console. Apparently ‘console’ is not a directory, so I can’t run the command php bin/console cache:clear like I did before when I initially downloaded Mautic manually (i.e. not using softaculous).

I then tried any and everything, including going to root folder/var/cache and running ‘rm -rf var/cache/*’ command line, nothing seemed to happen, even after refreshing Mautic page.

Any ideas? I’m new to all this, including using Terminal, but hopefully it shouldn’t be too difficult to figure out.

I’m trying to update to Mautic 4.4.10 but I know I will need to clear the cache because everything seems to break otherwise. I need to know if doing this update and then clearing the cache will fix the strange errors i’m suddenly getting like: e-mails in campaigns failing to send and contact segments not being rebuilt.

I may even have to change my cron jobs, I don’t know? Any help is appreciated.

If you used softaculous, then I assume you have a C panel and can access some sort of file manager?

To clear the cache, use the file manager to browse to

/www/html/mautic/var/cache/

The exact path may differ based on how softaculous set up you instance.

Delete all the folders in there. (make sure you have a back up just in case). The folders will regenerate when you next use Mautic.

I think it’s just “subdomain folder”/var/cache. I have two folders inside: ip_data (empty) and prod which contains 6 folders and numerous files. I delete both prod and ip_data files?

That’s right. But have back ups in case something goes wrong, but before I moved to using VPS’s, I ran mautics via c panel and I deleted the contents of the folder to clear the cache with success each time.

Wonderful, I’ll try that, thanks. I have another query. Are there any resources which will explain an alternative method to updating mautic through the interface? I’ve tried multiple times but it keeps getting stuck on the clear cache section.

The only way to update Mautic is via CLI (SSH)

Log into the box via terminal (using SSH)

php /var/www/mautic/bin/console mautic:update:apply

U will need to set the right path to your mautic for example a diff option might be

php /var/www/html/mautic/bin/console mautic:update:apply

You will be asked if you are sure. Enter Y

This goes and gets the latest version of mautic and runs the update - simple.

Once this complete u need to finish by

type or paste code here

php /var/www/mautic/bin/console mautic:update:apply --finish

Then we need to clear the cache

rm -rf /var/www/mautic/var/cache/*
And finally make sure the file permissions are correct
chown www-data:www-data /var/www/mautic

That was really helpful, it’s up to date now! I’m having trouble with the last command, however. What exactly does the www mean? I keep getting the error:

chown: invalid user: `www-data:www-data’

Do you have any examples of what this part could alternatively look like?

Try these 2 commands

sudo chown -R www-data:www-data /var/www/mautic/
sudo chmod -R 755 /var/www/mautic/

www-data is a user. Seems softaculous may not have set up that user. Adding sudo should sort that out.

I’ve just got around to trying it and received the following error:

bash: sudo: command not found

If you have a c panel and a file manager, try use that UI to set file permissions rather. Perhaps a right click on the mautic folder?

Screenshot 2023-09-26 at 14.51.41

What do you suggest I do? (These are the permissions for my subdomain folder)