How to include a PEAR library class into your script

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
seodevhead
Forum Regular
Posts: 705
Joined: Sat Oct 08, 2005 8:18 pm
Location: Windermere, FL

How to include a PEAR library class into your script

Post by seodevhead »

Hey guys... I need to have PEAR and it's DB class installed on my dedicated server just recently for use with a PHP script. When I go to the command prompt of my server and type in:

> PEAR list

I see all the PEAR libraries installed. However, I could not find them anywhere. So I emailed my system admin and he told me they were located at:

/usr/local/lib/php/

How do I access the PEAR files when they are located outside in such a directory that is inaccessible (to my knowledge) to my php scripts? Anyone know? Thanks for any help on this matter.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Does get_include_path() tell you the pear install location?
User avatar
seodevhead
Forum Regular
Posts: 705
Joined: Sat Oct 08, 2005 8:18 pm
Location: Windermere, FL

Post by seodevhead »

Hey feyd.. thanks for that link. I didn't realize that if you did:

include("{filename}");

..that it would default to usr/local/lib/php

I always thought it defaulted to the relative local directory where the script was... ie..

include('./{filename}');

I guess you learn something new everyday :)

Thanks feyd.
Post Reply