Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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.