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 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".