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 Designing Interfaces in PHP Introducing Interfaces Autoloading

code 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
PLUS
guellaf anas
Courses Plus Student 12,112 Points

please 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 following is the code <?php require_once "src\config.php"; $content= new collection(); $title = "My Website";

require 'views/header.php';

require 'views/footer.php';

guellaf anas
PLUS
guellaf anas
Courses Plus Student 12,112 Points

you must try using this require_once"src/config.php" instead of require_once"src\config.php". thanks

guellaf anas the code is continously showing after using (require_once"src/config.php")

Ashley Gordon
Ashley Gordon
10,827 Points

I had this problem for me, the file collection.php in the classes folder needed an uppercase "C", so it reads "Collection.php".