I'm trying to include file on ubuntu but I have a weird problem. The including file is in this path - /var/www/cms-dev/corefiles/classes/config.hp The file i'm trying to include is this file - /var/www/cms-dev/corefiles/lang.php
For some reason, while trying to include it it says that the file dosen't exist -
Warning: require_once(../lang.php) [function.require-once]: failed to open stream: No such file or directory in /var/www/cms-dev/corefiles/classes/config.php on line 9
SO for looking a solution for this I used scandir to scan the current directory and the upper directory.
For the current directory I got this using scandir("./") -
Array ( [0] => . [1] => .. [2] => .htaccess [3] => admin [4] => ckeditor [5] => corefiles [6] => index.php [7] => install.php [8] => log.txt )
For the current directory using scandir("/") I got this -
Array ( [0] => . [1] => .. [2] => bin [3] => boot [4] => cdrom [5] => dev [6] => etc [7] => home [8] => host [9] => initrd.img [10] => initrd.img.old [11] => lib [12] => lib64 [13] => lost+found [14] => media [15] => mnt [16] => opt [17] => proc [18] => root [19] => run [20] => sbin [21] => selinux [22] => srv [23] => sys [24] => tmp [25] => usr [26] => var [27] => vmlinuz [28] => vmlinuz.old )
For scanning the upper directory using scandir("../") I got this -
Array ( [0] => . [1] => .. [2] => cms-dev [3] => index.html [4] => info.php [5] => test.txt [6] => test.txt~ )
But config.php exists in /var/www/cms-dev/corefiles/classes/config.php I include it here - index.php and here urlHandler.php , but shouldn't config.php include the files relativley to himself?