Page 1 of 1

File inclusion error

Posted: Tue Jan 04, 2005 12:30 pm
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

Posted: Tue Jan 04, 2005 12:39 pm
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');