Re: Re: intalling pear:db

From: Date: Fri, 26 Nov 2004 04:38:53 +0000
Subject: Re: Re: intalling pear:db
References: 1 2 3 4 5  Groups: php.general 
Request: Send a blank email to php-general+get-202879@lists.php.net to get a copy of this message
Merlin wrote:
that did not help. The pear manual says that this can be installed via command line, plus "pear list" tells me that the package is installed. However if I call phpinfo() there is no mentioning about pear in any way?! Do I have to enable it first anyhow?`
I assume you have very little PHP experience, so I'll try not to skip any steps. Forget pear for now. in PHP, if you have this file: <?php include_once 'blah.php'; ?> then php.exe (on windows) or /usr/bin/php (in unix - path may vary) will read a special configuration variable called "include_path" that looks something like this: .;C:\php4 in windows or .:/usr/local/lib/php in unix PHP will pretend your script is: <?php include_once './blah.php'; ?> and if ./blah.php does not exist, it will try <?php include_once '/usr/local/lib/php/blah.php'; ?> See? So, if blah.php is actually located in /usr/lib/php/blah.php, php will not find it and cause an error. So, you have to change the include_path <?php set_include_path('/usr/lib/php' . PATH_SEPARATOR . get_include_path()); include_once 'blah.php'; ?> PEAR only installs files, it does not change include_path because this is impossible to do automatically. What you need to do is find the location of DB.php, and make sure the absolute path that leads to DB.php is in your include_path (/usr/local/lib/php/DB.php, perhaps, or C:\php4\pear\DB.php) Having said this, the error you are experiencing sounds like a bug in the code. There are two possibilities 1) there is a file named "DB.php" located in the "." directory, that is being included *before* pear's db would be included 2) there is an ancient version of DB.php that is being included before pear's DB.php the get_included_files() function can help you lots on this one http://us2.php.net/manual/en/function.get-included-files.php Greg

« previous php.general (#202879) next »