File inclusion error

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Atiq
Forum Commoner
Posts: 26
Joined: Thu Feb 19, 2004 5:23 am

File inclusion error

Post by Atiq »

PHP Warning: main(include/leftmenu_index_regsiter.php): failed to open stream: No such file or directory in D:\dss\abc\add.com\sad\ctu_register_s.php on line 76 PHP Warning: main(): Failed opening 'include/leftmenu_index_regsiter.php' for inclusion (include_path='.;c:\php\pear') in D:\dss\abc\add.com\sad\ctu_register_s.php on line 76

This file is definatly there and was working.
Do i have to make some change in php.ini or what?

Regards,
Atiq
rehfeld
Forum Regular
Posts: 741
Joined: Mon Oct 18, 2004 8:14 pm

Post by rehfeld »

on the line before calling the include, do this.

Code: Select all

echo getcwd();
you will see your relative file path is prob incorrect

i like to specify includes relative to the document root, instead of relative to the current working directory like your doing. that way you wont have this problem

Code: Select all

include($_SERVER['DOCUMENT_ROOT'] . '/path/to/file.php');
Post Reply