I'm working on a login script and i get these two errors after i try to insert the username / password in their appropriate fields: Warning: require_once(includes/config.inc.php) [function.require-once]: failed to open stream: No such file or directory in C:\wamp\www\link_manager\includes\login.inc.php on line 2 Fatal error: require_once() [function.require]: Failed opening required 'includes/config.inc.php' (include_path='.;C:\php5\pear') in C:\wamp\www\link_manager\includes\login.inc.php on line 2 PHP: On my includes\login.inc.php on line 2 i have this code: require_once("includes/config.inc.php"); //the configuration file PHP: Could you tell what is the problem with my code? Thanks!
1 possible solution: make your include path look like: include_path='.;C:\php5\pear;C:\wamp\www\link_manager' Code (markup): it is in php.ini 2 possible solution: require_once("./config.inc.php"); PHP: as I can see your login.inc.php is in the same directory as config.inc.php.
Are you sure you have correctly set your include path? You can also do this in code: $path = '/where/are/the/files/'; set_include_path(get_include_path() . PATH_SEPARATOR . $path); PHP: If that doesn't work, just try an absolute include path instead of a relative include path in your require statements. Probably if you're loading the config from the includes/login.php you don't need to do require 'includes/login.php' but just require 'login.php'
I tried using the absolute path, and it didn't work. I also tried using your suggestion, but it also didn't work. Any other suggestions please?
I finally got it working with the help of AsHinE. (Thanks AsHine!). It was an issue generated by the path, as you said. The solution was: I added these lines of code in my config.inc.php file: define ("SITE_URL", "/link_manager/"); define("SITE_PATH","C:\wamp\www\link_manager"); ini_set("include_path",SITE_PATH); PHP: Thank you for your help!