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

3 Answers

guellaf anas
PRO
guellaf anas
Pro Student 12,111 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 the code is continously showing after using (require_once"src/config.php")

guellaf anas
PRO
guellaf anas
Pro Student 12,111 Points

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