Jump to content

Recommended Posts

Posted

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

Posted

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!

Posted

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

Posted (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 by Steve Scrimpshire

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...