I’ve switched over to PHP5 on one of my sites and noticed that PEAR’s DB package doesn’t seem to have been included.

Is that true? Or am I just trying to include it wrong? Currently using this method which worked fine under PHP4:

It has the default packages installed with it. Unfortunately that does not include DB.

I can’t say if they plan on including that or not.

Ya this is a stupid question, but is there anything we can do to get db.php with PHP5?

If the core PEAR installed (which it was), you can use DB package even it is not installed by default (this is because DB package is ‘almost’ independent to PEAR).

Just go & download DB package ( Unzip the DB.php and DB folder to any directory under your website directory and include this DB.php.

So, instead of writing:


as normal, you just change it to:


and it will work.

A summary of situation: if you choose to run PHP5 in Dreamhost, you will not be able to use PEAR’s DB package by default. In my last post, I said it is possible to just download the DB package and upload to your own site’s directory to use.

However, from the help of Dreamhost team, there is a better way:

just include a line before you use DB:


and you’re ready to go.

I’m still having problems. I’m trying to install a software, I’ve added this

and it still doesn’t work…

I’ve managed to get thru: you do not have to put the require_once(‘DB.php’); line.

I am replying to this thread because it came up so highly in my google search and I thought others might need my solution.

To get the DB file to be found, you do need to change the set_include_path, but it needs to be changed to the path Dreamhost tells you to set in your phprc file.

This is what got mine working:
set_include_path(’/home/YOUR USERNAME HERE/pear/share/pear’);