Mautic Community Forums

Can't load New Template Email

Your software
My Mautic version is: 3.3.2
My PHP version is: 7.4.16
My Database type and version is: 10.2.37-MariaDB
My OS: Centos 7

Your problem
My problem is: When I’m trying to load new template email I get blank page.

These errors are showing in the log:
[2021-04-06 18:32:53] mautic.CRITICAL: Uncaught PHP Exception RuntimeException: “Unable to write in the cache directory (/var/www/html/app/…/var/tmp/twig/2d).” at /var/www/html/vendor/twig/twig/src/Cache/FilesystemCache.php line 61 {“exception”:"[object] (RuntimeException(code: 0): Unable to write in the cache directory (/var/www/html/app/…/var/tmp/twig/2d). at /var/www/html/vendor/twig/twig/src/Cache/FilesystemCache.php:61)"}

Steps I have tried to fix the problem:
I tried to restore/setup file permission but nothing changed.

sudo chown -R apache:apache /var/www/html/var/tmp/
chcon -t httpd_sys_content_rw_t /var/www/matomo/tmp

Thank you!

I tried to set all the permissions to apache user but I still get this:

[2021-04-07 12:09:08] mautic.CRITICAL: Uncaught PHP Exception RuntimeException: “Unable to write in the cache directory (/var/www/html/app/…/var/tmp/twig/02).” at /var/www/html/vendor/twig/twig/src/Cache/FilesystemCache.php line 61 {“exception”:"[object] (RuntimeException(code: 0): Unable to write in the cache directory (/var/www/html/app/…/var/tmp/twig/02). at /var/www/html/vendor/twig/twig/src/Cache/FilesystemCache.php:61)"}

Can someone help?
Thank you!

Here is the solution: CentOS 7 + SELinux + PHP + Apache – cannot write/access file no matter what | Lysender's Daily Log Book

sudo chcon -t httpd_sys_rw_content_t /var/www/html/var/tmp/ -R worked for me! :slight_smile:

1 Like