Page 1 of 1

How to include a PEAR library class into your script

Posted: Mon Mar 12, 2007 2:58 pm
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.

Posted: Mon Mar 12, 2007 3:15 pm
by feyd
Does get_include_path() tell you the pear install location?

Posted: Mon Mar 12, 2007 7:47 pm
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.