PEAR DB w/ PHP5

PEAR DB w/ PHP5

Posted by: Gobalopper
Posted on: 2005-06-06 15:20:00

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:
include_once('DB.php');

Re: PEAR DB w/ PHP5

Posted by: guice
Posted on: 2005-06-06 16:50:00

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.

Re: PEAR DB w/ PHP5

Posted by: rinvelt
Posted on: 2005-06-24 08:51:00

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

Re: PEAR DB w/ PHP5

Posted by: leduytien
Posted on: 2006-02-14 05:37:00

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 (http://pear.php.net/package/DB/download). Unzip the DB.php and DB folder to any directory under your website directory and include this DB.php.

So, instead of writing:

require_once('DB.php');

as normal, you just change it to:

require_once('path/to/your/DB.php');

and it will work.

Now PEAR DB with PHP5 in Dreamhost

Posted by: leduytien
Posted on: 2006-02-16 00:56:00

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:

set_include_path('/usr/local/lib/php');
require_once('DB.php');

and you're ready to go.

Re: Now PEAR DB with PHP5 in Dreamhost

Posted by: willdex
Posted on: 2006-12-17 22:05:00

I'm still having problems. I'm trying to install a software, I've added this
set_include_path('/usr/local/lib/php');
require_once('DB.php');

and it still doesn't work...

Re: Now PEAR DB with PHP5 in Dreamhost

Posted by: willdex
Posted on: 2006-12-18 12:40:00

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

Tags: php5pearphp4switchedphp