Is it possible in php.ini declare $basedir(for libraries)?
From: Richard Davey <[EMAIL PROTECTED]> Reply-To: Richard Davey <[EMAIL PROTECTED]> To: [EMAIL PROTECTED] Subject: Re: [PHP] failed to open stream: No such file or directory in Date: Mon, 15 Mar 2004 17:55:13 +0000
Hello Mike,
Monday, March 15, 2004, 5:43:14 PM, you wrote:
MM> But When I try to declare the library in /var/ww/html/account/ MM> include('lib/account/lib_main.php');
lib_main.php = /var/www/html/lib/lib_main.php index.php = /var/www/html
You are including files RELATIVE to the location of the script. At the point in which you try to include the lib_main file, you are currently in the account directory, so it's trying to look for:
/var/www/html/account/lib/account/lib_main.php
which, needless to say, doesn't exist.
A good solution to save you some hassle will be to define a global variable/constant called something like $basedir and set that.
$basedir = "/var/www/html";
Now just use this in all your include lines:
include "$basedir/lib/lib_main.php";
This will work from *anywhere* and not fail.
-- Best regards, Richard Davey http://www.phpcommunity.org/wiki/296.html
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
_________________________________________________________________
Get business advice and resources to improve your work life, from bCentral. http://special.msn.com/bcentral/loudclear.armx
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php