Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Finished installing Drupal 8, redirected to the homepage, but the homepage was blank. Looked in apache error.log, and found this:
[Sat Apr 05 14:04:54.858280 2014] [:error] [pid 25720] [client xx.xxx.xx.xx:64628] PHP Fatal error: Class '__TwigTemplate_7840d7458122591ed21a153648c8459715287fe1203b7d56ae3ec2a4b4bfcb1e' not found in /var/www/core/lib/Drupal/Core/Template/TwigEnvironment.php on line 125, referer: http://example.com/core/install.php?langcode=en&profile=standard
[Sat Apr 05 14:05:00.369482 2014] [:error] [pid 25014] [client xx.xxx.xx.xx:64632] PHP Fatal error: Class '__TwigTemplate_7840d7458122591ed21a153648c8459715287fe1203b7d56ae3ec2a4b4bfcb1e' not found in /var/www/core/lib/Drupal/Core/Template/TwigEnvironment.php on line 125
[Sat Apr 05 14:05:05.474080 2014] [:error] [pid 25012] [client xx.xxx.xx.xx:64633] PHP Fatal error: Class '__TwigTemplate_7840d7458122591ed21a153648c8459715287fe1203b7d56ae3ec2a4b4bfcb1e' not found in /var/www/core/lib/Drupal/Core/Template/TwigEnvironment.php on line 125
[Sat Apr 05 14:05:14.787973 2014] [:error] [pid 24999] [client xx.xxx.xx.xx:64634] PHP Fatal error: Class '__TwigTemplate_7840d7458122591ed21a153648c8459715287fe1203b7d56ae3ec2a4b4bfcb1e' not found in /var/www/core/lib/Drupal/Core/Template/TwigEnvironment.php on line 125
I replaced client with xx's and referrer with example.com
I have php 5.5.3 running on apache with mysql 5.5.35
Comments
Comment #1
mgiffordYou might need to re-install Drupal. It could be that there were leftover pre-compiled files in the sites/default/files directory that are messing things up.
EDIT: Did you install with drush? Something like:
drush @drupal8 si standard -y
Comment #2
kadimi CreditAttribution: kadimi commented@mgifford, me I did it with
drush @drupal8 si standard -y
like instucted in VDD.I got the same error with VDD. The funny part is that it worked in another computer, with exact same installation process, the only difference I could find was that if worked on the computer with Vagrant 1.3.5 and didn't in the one with 1.5.1.
Comment #3
mgiffordThat's an odd one for sure... I'll try to let you know if I figure it out.
Comment #4
wylbur CreditAttribution: wylbur commentedI got similar errors when I replicated the website instance. When I emptied the files directory, the errors went away.
Comment #5
ekes CreditAttribution: ekes commentedCertainly if deleting files directory solves it. It sounds like when on the command line using drush to install the files directory and contents didn't become read/write for the webserver: because of ownership/permission or SE Linux context.
Comment #6
MichelleI have this same problem every time I install D8. I use drush si and it will work fine but the site gives me a WSOD until I do a chmod 777 on the sites/default/files directory. This is on Ubuntu 14.04 and PHP 5.5.
(I put a bit more info in the title to make this easier to find)
Comment #7
dysproseum CreditAttribution: dysproseum commentedFor me I needed to update my mount settings because I'm running Drupal inside a Vagrant box. Found here http://jeremykendall.net/2013/08/09/vagrant-synced-folders-permissions/ some settings to change the mount permissions:
Comment #8
geerlingguy CreditAttribution: geerlingguy commentedIn setting up the Dramble cluster of D8 servers, I was running into the same issue. A while back, it had to do with file permissions issues in the shared GlusterFS mount, but I had resolved that error. After a few hours' debugging, I found that this WSOD and the exact same error can be caused by time drift on multiple servers with a shared mount.
It was the strangest thing, too. If I pointed the load balancer at just one of the servers, everything worked perfectly. If I pointed it at more than one server, then after accessing the second server, the Twig error would start popping up in the logs for all servers, and they'd all WSOD. Then if I pointed the balancer at one server again, that server would load Drupal just fine.
In my case, since I was using Raspberry Pis (without built-in clocks) on a local network, the time from system boot had about +/- 3 seconds of drift, and apparently that was enough to cause this strange error. I even tried having APC on with stat=0, APC on with stat=1, and APC off, and none of those changes made a difference.
Comment #9
star-szrThanks for the report @geerlingguy! Adding a very related (possibly the same) issue, but this may have multiple causes.
Comment #10
opdavies@dysproseum's suggestion in #7 to update the mount settings in Vagrantfile seemed to have fixed it for me.
Comment #11
star-szrNow closing as a duplicate of #2429659: Race conditions in the twig template cache. This issue can be re-opened if need be.
Comment #12
sharif.elshobkshy CreditAttribution: sharif.elshobkshy commentedRecreated the environment from scratch and the error went away.
It seems I had something cached bothering from a different branch I had earlier in the day.