MDB2 connect failure - php5,

From: Date: Mon, 12 Mar 2007 03:36:09 +0000
Subject: MDB2 connect failure - php5,
Groups: php.pear.general 
Request: Send a blank email to pear-general+get-26821@lists.php.net to get a copy of this message
Hi all - some progress. I am a newbie. I have a test database - bpsimple. I can log in from the command line with username minitwr and pwd RWHart (not production and not online). pear list reports: Installed packages, channel pear.php.net: =========================================
Package           Version State
Archive_Tar       1.3.1   stable
Console_Getopt    1.2     stable
DB                1.7.6   stable
MDB2              2.3.0   stable
MDB2_Driver_pgsql 1.3.0 stable
PEAR              1.4.9   stable
XML_RPC           1.5.0   stable
require_once 'MDB2.php' ; $dsn = "pgsql://minitwr:RWHart@localhost/bpsimple" ; $mdb2 =& MDB2::connect($dsn) ; if (PEAR::isError($mdb2) ) { die( "Error Reported: " . $mdb2->getMessage() . "\n"."<br />" ) ; } print "ERROR REPORTED: " . $errorReported ."\n" . "<br/>" ; In php5 I use the following script that reports that it cannot connect with :
    MDB2 Error: connect failed.
require_once 'MDB2.php' ; $dsn = "pgsql://minitwr:RWHart@localhost/bpsimple" ; $mdb2 =& MDB2::connect($dsn) ; if (PEAR::isError($mdb2) ) { die( "Error Reported: " . $mdb2->getMessage() ) ; } Note that the username and password are identical to those used with psql on the command line. I can connect with pg_connect() without any problem. I have tried various combinations of require-once (e.g. require_once "MDB2.php", require_once("MDB2.php") and it doesn't make any difference. ideas? Thanks, Bob

« previous php.pear.general (#26821) next »