Path To Pear?

windows

Guest
I've never messed with the PEAR libraries before, but now I'm working on a script that uses them...<br /><br />First line is:<br /><br /><!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->//require the PEAR::DB classes.<br />require_once 'DB.php';<!--c2--></div><!--ec2--><br /><br />...of course, the path to DB.php (if it exists) is wrong.<br /><br />Is PEAR automatically included in the hosting packages (I'm on a reseller account)?<br /><br />If so, what is the path?<br /><br />If not, I guess I have to install it on each user account I want to use it on?<br /><br /><br />thanks!<br /><br />Mel<!--content-->
Mel,<br /><br />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.<br /><br />Good luck!<!--content-->
I opened a support ticket, and they told me:<br /><br /><b><i>The path to pear is /usr/local/bin/pear</i></b><br /><br />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.<br /><br />My script looks like this:<br /><br /><!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->//require the PEAR::DB classes.<br />// path to PEAR<br />ini_set('include_path', "/usr/local/bin/pear". ini_get("include_path"));<br />require_once('MDB2.php');<!--c2--></div><!--ec2--><br /><br /><br />and the server tells me:<br /><!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->Warning: main(MDB2.php): failed to open stream: No such file or directory in /home/myaccount/db_connect.php on line 6<br /><br />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<!--c2--></div><!--ec2-->(same thing happens when I try to use require_once('DB.php');<br /><br /><br />line 6 is:<br /><!--c1--><div class='codetop'>CODE</div><div class='codemain'><!--ec1-->require_once('MDB2.php');<!--c2--></div><!--ec2--><br /><br /><br />So I"m getting to the right place now, I'm just not finding the required files..<br /><br /><br />anyone have any suggestions?<br /><br /><br /><br />~peace~<br />Mel<!--content-->
On my Linux box, those two files are found in /usr/share/php/Auth/Container/<br />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.<br /><br />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<br /><br />These are places I would also try:<br />/usr/lib/pear<br />/usr/local/lib/pear<br />/usr/lib/php/pear<br />/usr/local/lib/php/pear<br /><br />But they are just guesses.<!--content-->
 
Back
Top