MelH Posted June 26, 2006 Posted June 26, 2006 I've never messed with the PEAR libraries before, but now I'm working on a script that uses them... First line is: >//require the PEAR::DB classes. require_once 'DB.php'; ...of course, the path to DB.php (if it exists) is wrong. Is PEAR automatically included in the hosting packages (I'm on a reseller account)? If so, what is the path? If not, I guess I have to install it on each user account I want to use it on? thanks! Mel Quote
abinidi Posted June 26, 2006 Posted June 26, 2006 Mel, Pear seems to be included, as I've seen other references to it here in the forums. However, I can't find anything that explains the path to Pear. Somebody else will have to come along to give that to you. Good luck! Quote
MelH Posted June 26, 2006 Author Posted June 26, 2006 I opened a support ticket, and they told me: The path to pear is /usr/local/bin/pear My script is no longer complaining about the path, but it can't find either of the database files I'm looking for: DB.php and MDB2.php. My script looks like this: >//require the PEAR::DB classes. // path to PEAR ini_set('include_path', "/usr/local/bin/pear". ini_get("include_path")); require_once('MDB2.php'); and the server tells me: >Warning: main(MDB2.php): failed to open stream: No such file or directory in /home/myaccount/db_connect.php on line 6 Fatal error: main(): Failed opening required 'MDB2.php' (include_path='/usr/local/bin/pear.:/usr/lib/php:/usr/local/lib/php') in /home/myaccount/db_connect.php on line 6 (same thing happens when I try to use require_once('DB.php'); line 6 is: >require_once('MDB2.php'); So I"m getting to the right place now, I'm just not finding the required files.. anyone have any suggestions? ~peace~ Mel Quote
Steve Scrimpshire Posted June 27, 2006 Posted June 27, 2006 (edited) On my Linux box, those two files are found in /usr/share/php/Auth/Container/ from the php-auth package. I do not see the auth module installed on Server44, but I am not a reseller. I have uploaded libs to my server (in my home directory) before to satisfy some issues and just edited the path in the script's config file to point to the directory they are in. I would make a totally separate directory outside of public_html. Edit: MDB.php also happens to be in the pkg php-pear-MDB, which makes more sense in this situation. Try pointing your config file to /usr/local/share/pear or /usr/share/pear These are places I would also try: /usr/lib/pear /usr/local/lib/pear /usr/lib/php/pear /usr/local/lib/php/pear But they are just guesses. Edited June 27, 2006 by Steve Scrimpshire Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.