Your software
My Mautic version is: 4.4.4, fresh install from zip file.
My PHP version is: 7.4.30
My Database type and version is: mysql Ver 15.1 Distrib 10.5.15-MariaDB, for debian-linux-gnu (x86_64)
Web sever: nginx 1.18.0
Your problem
My problem is: I removed the cache as sudo user (sudo rm -rf var/cache/*
which I should not have done). After that the mautic page is down.
It is still not working.
These errors are showing in the log:
[2022-11-11 13:02:45] mautic.CRITICAL: Uncaught PHP Exception Symfony\Component\Filesystem\Exception\IOException: "Cannot rename "/tmp/UrlMatcher.phpIClvgH" to "/var/www/html/mautic/var/cache/prod/UrlMatcher.php"." at /var/www/html/mautic/vendor/symfony/filesystem/Filesystem.php line 290 {"exception":"[object] (Symfony\\Component\\Filesystem\\Exception\\IOException(code: 0): Cannot rename \"/tmp/UrlMatcher.phpIClvgH\" to \"/var/www/html/mautic/var/cache/prod/UrlMatcher.php\". at /var/www/html/mautic/vendor/symfony/filesystem/Filesystem.php:290)"} {"hostname":"vps","pid":32368}
[2022-11-11 13:02:45] mautic.NOTICE: PHP Notice - Undefined variable: inline - in file /var/www/html/mautic/offline.php - at line 77 {"inTemplate":true,"isAjax":false,"message":"The site is currently offline due to encountering an error. If the problem persists, please contact the system administrator.","submessage":"System administrators, check server logs for errors.","inDev":false,"base":"/","root":"/var/www/html/mautic","assetPrefix":"","paths":{"themes":"themes","assets":"media","asset_prefix":"","plugins":"plugins","translations":"translations","local_config":"%kernel.root_dir%/config/local.php","root":"/var/www/html/ma","app":"app","bundles":"app/bundles","vendor":"vendor"},"assetBase":"/media"} {"hostname":"vps","pid":32368}
[2022-11-11 13:02:45] mautic.ERROR: Symfony\Component\Filesystem\Exception\IOException: Cannot rename "/tmp/UrlGenerator.phpICXWeH" to "/var/www/html/mautic/var/cache/prod/UrlGenerator.php". - in file /var/www/html/mautic/vendor/symfony/filesystem/Filesystem.php - at line 290 [] {"hostname":"vps","pid":32368}
[2022-11-11 13:34:03] mautic.NOTICE: PHP Notice - SessionHandler::gc(): ps_files_cleanup_dir: opendir(/var/lib/php/sessions) failed: Permission denied (13) - in file /var/www/html/mautic/vendor/symfony/http-foundation/Session/Storage/Handler/StrictSessionHandler.php - at line 106 {"maxlifetime":1440} {"hostname":"vps","pid":524}
[2022-11-11 13:54:43] mautic.NOTICE: PHP Notice - SessionHandler::gc(): ps_files_cleanup_dir: opendir(/var/lib/php/sessions) failed: Permission denied (13) - in file /var/www/html/mautic/vendor/symfony/http-foundation/Session/Storage/Handler/StrictSessionHandler.php - at line 106 {"maxlifetime":1440} {"hostname":"vps","pid":523}
Steps I have tried to fix the problem:
- I reset the permissons and owner of the mautic directory, clear the cache following this guide https://docs.mautic.org/en/troubleshooting/file-ownership-and-permissions. This time I perform the commands as the user of the web server. Still not working.
as www-data, I ran:
find . -type f -not -perm 644 -exec chmod 644 {} +
find . -type d -not -perm 755 -exec chmod 755 {} +
chmod -R g+w var/cache/ var/logs/ app/config/
chmod -R g+w media/files/ media/images/ translations/
rm -rf var/cache/*
as sudo, I ran:
sudo chown -R www-data:www-data /path/to/mautic
-
restart php, nginx and the server. it does not help.
-
I think this is related to the permisson, but don’t know what to do more than the link above.
Thank you for your support. Cheers.