require_once('') relative path problem
| From: | Sheeraz fazal | Date: | Thu, 22 Apr 2004 20:34:23 +0000 |
| Subject: | require_once('') relative path problem | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-184293@lists.php.net to get a copy of this message | ||
Hi,
I have problem in undertanding the require_once/require/include/include_once
functionality. Php files in my project are located in different folders.
Some folders have common files for other files. And file layout is like this
/*
File: a.php
*/
require_once('../test/db.php');
...
/*
File: db.php
*/
require_once('../globals/global.php');
...
when i include a.php in another file i get error for global.php file that
path could not be found. And if i correct the path in db.php then someother
file which is using db.php will get error. So, can someone elaborate that
how relative path works in require_once. what is the starting directory for
require_once function which is using relative path.
Or
Is there any way that i can included some constant which include the
absolute path from which all relative paths can be determined?
Comments welcome.