HTML/PHP Require Error -
i working on personal project able write web page uses 1 page. running error in 1 directory of web page same code works in other places.
errors:
warning: require(mainclass.php): failed open stream: no such file or directory in c:\xampp\htdocs\testproj\cssfiles\index.html on line 3
fatal error: require(): failed opening required 'mainclass.php' (include_path='../testproj/phpclasses') in c:\xampp\htdocs\testproj\cssfiles\index.html on line 3
code:
<?php set_include_path("../testproj/phpclasses"); require "mainclass.php"; $controller = new mainclass(); ?>
can assist me this?
i assume, not need 'testproj' in include path should ..\phpclasses
however, not recommend overwrite include path calling set_include_path
, because in example exclude standard libraries path. use require "../phpclasses/mainclass.php";
without set_include_path(...)
Comments
Post a Comment