Re: Re: intalling pear:db

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux