Could not render Twig template : Unable to create the cache directory (/tmp/cornerstone/twig/78)

Heya, Hope you’re having a great day!

Having an issue when the Twig cache is enabled on a site. I get the below error for any dynamic content in Cornerstone, and none of the dynamic content is updated (e.g. it still shows as {{ looper.item }}). It does work with the cache option disabled, and it does work with an almost identical site on the same server.

Could not render Twig template : 
Unable to create the cache directory (/tmp/cornerstone/twig/78).

Here’s what I’ve tried and the issue persists:

  • Plugin conflict test: disabled all plugins on the site
  • Disabled & re-enabled “Cache” option in twig options (saving between changes)
  • Disabled & re-enabled Twig in Theme Options (saving between changes)
  • Used “Pro” theme instead of child theme
  • Switched between Wordpress 2024 theme, and back to Pro
  • Checked wordpress error log - nothing I can see in there!
  • Tried all different types of loopers: JSON, Recent Posts, Query Builder etc

Here’s some details which may be of help:

Wordpress.    6.6.2
Pro Theme     6.5.8
Server architecture	Linux 5.10.0-26-amd64 x86_64
Web server	Apache/2.4.62 (Debian)
PHP version	8.2.23 (Supports 64bit values)
PHP SAPI	fpm-fcgi
PHP max input variables	10000
PHP time limit	300
PHP memory limit	512M

It sounds like PHP can’t write to the temporary directory. I would reach out to your host and try to give WordPress the ability to write to that temporary directory. There are other Cornerstone features like Template creation that rely on the temporary directory being writable so I would try to fix it this way. If you have another site able to use this feature, I would try restarting your server which will remove all items in the temporary directory.

If that is not an option, you can also change the twig cache directory through this filter.

Let us know if that helps.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.