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 trialAbdul Hadi Mateen
287 Pointscode is continuously showing error in preview
Warning: require_once(src\config.php): failed to open stream: No such file or directory in /home/treehouse/workspace/index.php on line 2
Fatal error: require_once(): Failed opening required 'src\config.php' (include_path='.:/usr/share/pear:/usr/share/php') in /home/treehouse/workspace/index.php on line 2
4 Answers
guellaf anas
Courses Plus Student 12,112 Pointsplease could you show me your code, because i think it should be the statement for requiring config file, example: require_one("src/config.php"); // error in forward slash
guellaf anas
Courses Plus Student 12,112 Pointsyou must try using this require_once"src/config.php" instead of require_once"src\config.php". thanks
Abdul Hadi Mateen
287 Pointsguellaf anas the code is continously showing after using (require_once"src/config.php")
Ashley Gordon
10,827 PointsI had this problem for me, the file collection.php in the classes folder needed an uppercase "C", so it reads "Collection.php".
Abdul Hadi Mateen
287 PointsAbdul Hadi Mateen
287 Pointsguellaf anas following is the code <?php require_once "src\config.php"; $content= new collection(); $title = "My Website";
require 'views/header.php';
require 'views/footer.php';