PHP require problem with “./”

prostypra

New Member
I have a file index.php in root directory:\[code\]<?phprequire_once "./include/common.php";?>\[/code\]and file common.php in include folder:\[code\]<?phprequire_once "globalConfig.php";?>\[/code\]file globalConfig in the same folder with common.php. The tree folder as:xxx/index.phpxxx/include/common.phpxxx/include/globalConfig.phpindex.php run normally. But if I change file common.php as:\[code\]<?phprequire_once "./globalConfig.php";?>\[/code\]PHP show a warning that it cannot find the globalConfig.php file. What is the difference? I think int the case with "./", the most outside including file (index.php) will find the globalConfig.php in its current directory.
 
Back
Top