Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

PHP Building Websites with PHP Slim Basics & Twig Templates Layouts with Twig

Richard Lake
Richard Lake
20,462 Points

Uncaught ErrorEception: require_once(Autoloader.php)... line 117 Twig.php

Stuck again... after following this video half way through and refreshing index.php I get the following error regarding Autoloader.php

Warning: Uncaught ErrorException: require_once(/Autoloader.php): failed to open stream: No such file or directory in /home/treehouse/workspace/vendor/slim/views/Twig.php:117 Stack trace: #0 /home/treehouse/workspace/vendor/slim/views/Twig.php(117): Slim\Slim::handleErrors(2, 'require_once(/A...', '/home/treehouse...', 117, Array) #1 /home/treehouse/workspace/vendor/slim/views/Twig.php(117): require_once() #2 /home/treehouse/workspace/vendor/slim/views/Twig.php(86): Slim\Views\Twig->getInstance() #3 /home/treehouse/workspace/vendor/slim/slim/Slim/View.php(255): Slim\Views\Twig->render('about.twig', NULL) #4 /home/treehouse/workspace/vendor/slim/slim/Slim/View.php(243): Slim\View->fetch('about.twig', NULL) #5 /home/treehouse/workspace/vendor/slim/slim/Slim/Slim.php(757): Slim\View->display('about.twig') #6 /home/treehouse/workspace/index.php(31): Slim\Slim->render('about.twig') #7 [internal function]: {closure}() #8 /home/treehouse/workspace/vendor/slim/slim/Slim/Route.php(468): call_user_func_array(Object(Closure), Arr in /home/treehouse/workspace/vendor/slim/views/Twig.php on line 117

Fatal error: Slim\Views\Twig::getInstance(): Failed opening required '/Autoloader.php' (include_path='.:/usr/share/pear:/usr/share/php') in /home/treehouse/workspace/vendor/slim/views/Twig.php on line 117

2 Answers

Algirdas Lalys
Algirdas Lalys
9,389 Points

Hi Richard,

I had pretty same error and I tryed one trick which worked for me. I have downgraded twig engine to version 1.18 which is used in this video. I have typed in console 1) 'composer require' -> hit enter 2) then typed twig -> hit enter 3) then choose a number for 'twig/twig' -> hit enter 4) and finally entered version '1.18' -> hit enter. And it worked for me.

Alexander Alegre
Alexander Alegre
14,340 Points

Algirdas, thanks for the reply. I had the same issue and it worked for me.