• Hi, I am upgrading PHP on this website, since we are using PHP 7.4, however, once I go to PHP 8.0+ I get a Fatal error and I see this on the error log:

    PHP Fatal error:  Uncaught Error: Undefined constant "ENV" in /dom42117/wp-content/plugins/timber-library/vendor/twig/twig/src/Extension/CoreExtension.php:1661
    Stack trace:
    #0 /dom42117/wp-content/plugins/timber-library/vendor/twig/twig/src/Extension/CoreExtension.php(1661): constant('ENV')
    #1 /dom42117/wp-content/plugins/timber-library/vendor/twig/twig/src/Environment.php(497) : eval()'d code(30): twig_constant('ENV')
    #2 /dom42117/wp-content/plugins/timber-library/vendor/twig/twig/src/Template.php(453): __TwigTemplate_53e9d8e1532f224322e40f11d9628ced0ef859351326ec40020691e39bf7212b->doDisplay(Array, Array)
    #3 /dom42117/wp-content/plugins/timber-library/vendor/twig/twig/src/Template.php(420): Twig\Template->displayWithErrorHandling(Array, Array)
    #4 /dom42117/wp-content/plugins/timber-library/vendor/twig/twig/src/Environment.php(497) : eval()'d code(84): Twig\Template->display(Array)
    #5 /dom42117/wp-content/plugins/timber-library/vendor/twig/twig/src/Template.php(453): __TwigTemplate_463bbf3a9ad038b5ee00f4f934eb82c973c950e04f16fdf7b490be87ad3d210b->doDisplay(Array, Array)
    #6 /dom42117/wp-content/plugins/timber-library/vendor/twig/twig/src/Template.php(420): Twig\Template->displayWithErrorHandling(Array, Array)
    #7 /dom42117/wp-content/plugins/timber-library/vendor/twig/twig/src/Environment.php(497) : eval()'d code(35): Twig\Template->display(Array, Array)
    #8 /dom42117/wp-content/plugins/timber-library/vendor/twig/twig/src/Template.php(453): __TwigTemplate_6117eef2967e4024a8ddd13d22f98637553697006029f77f64e8511beda77b5b->doDisplay(Array, Array)
    #9 /dom42117/wp-content/plugins/timber-library/vendor/twig/twig/src/Template.php(420): Twig\Template->displayWithErrorHandling(Array, Array)
    #10 /dom42117/wp-content/plugins/timber-library/vendor/twig/twig/src/Environment.php(497) : eval()'d code(31): Twig\Template->display(Array)
    #11 /dom42117/wp-content/plugins/timber-library/vendor/twig/twig/src/Template.php(453): __TwigTemplate_1412182097d0a23bc5f170f22c3537c40d9efcdedeb01625fc6e0e9929b2a5d5->doDisplay(Array, Array)
    #12 /dom42117/wp-content/plugins/timber-library/vendor/twig/twig/src/Template.php(420): Twig\Template->displayWithErrorHandling(Array, Array)
    #13 /dom42117/wp-content/plugins/timber-library/vendor/twig/twig/src/Template.php(432): Twig\Template->display(Array)
    #14 /dom42117/wp-content/plugins/timber-library/vendor/twig/twig/src/TemplateWrapper.php(47): Twig\Template->render(Array, Array)
    #15 /dom42117/wp-content/plugins/timber-library/lib/Loader.php(79): Twig\TemplateWrapper->render(Array)
    #16 /dom42117/wp-content/plugins/timber-library/lib/Timber.php(334): Timber\Loader->render('page.twig', Array, false, 'default')
    #17 /dom42117/wp-content/plugins/timber-library/lib/Timber.php(383): Timber\Timber::compile(Array, Array, false, 'default', true)
    #18 /dom42117/wp-content/plugins/timber-library/lib/Timber.php(410): Timber\Timber::fetch(Array, Array, false, 'default')
    #19 /dom42117/wp-content/themes/accedian/page.php(70): Timber\Timber::render(Array, Array)
    #20 /wordpress-versions/6.1.1/wp-includes/template-loader.php(106): include('/dom42117/wp-co...')
    #21 /wordpress-versions/6.1.1/wp-blog-header.php(19): require_once('/wordpress-vers...')
    #22 /wordpress-versions/6.1.1/index.php(17): require('/wordpress-vers...')
    #23 {main}
      thrown in /dom42117/wp-content/plugins/timber-library/vendor/twig/twig/src/Extension/CoreExtension.php on line 1661

    I went back to PHP 7.4 and it is ok now, do you guys have any idea?

    Timber Plugin is on its latest version.

    • This topic was modified 1 year, 11 months ago by castiblanco.

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘PHP Fatal error after PHP upgrade’ is closed to new replies.