PEAR DB Help

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

aliasxneo
Forum Contributor
Posts: 136
Joined: Thu Aug 31, 2006 12:01 am

Post by aliasxneo »

Well, after examining the DB.php file I found out that you can set a debug variable when you connect that spits out errors, and now I am finally receiving some errors:

Code: Select all

Warning: require_once(DB/common.php) [function.require-once]: failed to open stream: No such file or directory in /home/coolmail/public_html/includes/system/PEAR/DB/mysql.php on line 30

Fatal error: require_once() [function.require]: Failed opening required 'DB/common.php' (include_path='.:/usr/local/php5-fcgi/lib/php') in /home/coolmail/public_html/includes/system/PEAR/DB/mysql.php on line 30
That's at http://www.coolmailengine.com/test.php

The only problem is that common.php does exist in /home/coolmail/public_html/includes/system/PEAR/DB. The only thing I can think of is that it's trying to include DB/common.php rather than the full path I just specificed above. Is there a way to make it use the full path without editing the file directly?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Your include path needs to be adjusted to include the root path of PEAR's installation directory.

set_include_path().
aliasxneo
Forum Contributor
Posts: 136
Joined: Thu Aug 31, 2006 12:01 am

Post by aliasxneo »

Is there another way to do that? As I said before, PEAR is not locally on the system it's apart of my framework located in /home/coolmail/public_html/includes/system/PEAR. Changing the include path might mess somethings up.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Unless you want to alter the PEAR files, that's how they are engineered. You can tack the path onto the end of your paths.. e.g.

Code: Select all

set_include_path(get_include_path() . PATH_SEPARATOR . $pearPath);
...or you can alter it with .htaccess directives.
d3ad1ysp0rk
Forum Donator
Posts: 1661
Joined: Mon Oct 20, 2003 8:31 pm
Location: Maine, USA

Post by d3ad1ysp0rk »

I see content on your page.. did you fix it?
aliasxneo
Forum Contributor
Posts: 136
Joined: Thu Aug 31, 2006 12:01 am

Post by aliasxneo »

Yea, I just defined a variable named PEAR_PATH and edited mysql.php to include that path when including other files. Shouldn't hurt too much, only one line, and it works both on my computer and my system.

Anyways, thanks for all the helps guys :)
Post Reply