Your software
My Mautic version is: 5
My PHP version is: 8.0.30
My Database type and version is: MariaDB 10.3.39
Your problem
My problem is: Mautic login page won’t load
These errors are showing in the log:
[Sun Apr 21 01:55:49.652470 2024] [proxy_fcgi:error] [pid 37775] [client 127.0.0.1:44904] AH01071: Got error ‘PHP message: PHP Warning - mkdir(): File exists - in file /var/www/vhosts/domain.com/mautic.domain.com/docroot/app/bundles/CoreBundle/Cache/MiddlewareCacheWarmer.php - at line 57PHP message: PHP Warning: mkdir(): File exists in /var/www/vhosts/domain.com/mautic.domain.com/docroot/app/bundles/CoreBundle/Cache/MiddlewareCacheWarmer.php on line 57PHP message: RuntimeException: Unable to create the “cache” directory (/var/www/vhosts/domain.com/mautic.domain.com/app/…/var/cache/prod). - in file /var/www/vhosts/domain.com/mautic.domain.com/vendor/symfony/http-kernel/Kernel.php - at line 638’
Steps I have tried to fix the problem:
I ran the following ps aux | grep apache2 to see what the apache user is that the server uses, and it matches to what the “cache” folder owner is. I read online that on “almalinux 8.9” the apache user is “apache” but I don’t see that user when I run the above command.
I just got a new dedicated server and I was trying to update from Mautic 2 to Mautic 5. I was able to upgrade properly to Mautic 3 and then Mautic 4 from the website option. Then I following the instructions below to try to update from Mautic 4 to Mautic 5 using “Composer”, but now I’m stuck with the website not loading because of this “cache” folder issue.
So I ended up installing a new copy of Mautic 5 on a different subdomain, once it installed I just copied over the files to my original subdomain and connected it to the existing DB I was originally using.
This allowed me to finally get the website working and I was able to login to Mautic, however, now I notice some pages just don’t load; for example, “Tags”, “API Credentials”, “Account”, etc. I cleared cache but that didn’t work either.
I then ran the following to migrate any DB issues, and you can see the results in the screenshot image link below.
I was able to get this to work, for anyone else facing this issue…
I ended up using the “Devart dbForge Schema Compare for MySQL” software to compare the database structures of the fresh install of Mautic to my existing Mautic that had issues. It seems like the database structures weren’t the same even after successfully running the following commands.
I then use dbForge software to synchronize my existing Matic database structure that seemed to fail during my upgrade to Mautic 5 with the fresh installation that I made of Mautic 5.
After doing this my existing Mautic website works properly now and I don’t have anymore issues with pages not loading.
I feel like I’m talking to myself on this support forum, but hopefully this helps someone else going through this issue and can use the steps I took to fix their existing Mautic application when an upgrading Mautic fails.
Yes, at that time I was just trying different things because I was getting no where in solving this issue. Now that I fixed it and Mautic is running properly, I’ll go back and change the permissions back to what they were before.