DB Error: extension not found
374864Aug 9 2006 — edited Aug 9 2006I am trying to use PEAR DB with PHP and Oracle.
I have PEAR working well with mysql. I am able to connect to MYSQL. But when I try to interact with Oracle, I am not able to connect.
I get the following error:
"DB Error: extension not found"
I get the same error when I try to use "mysqli"
Here what I am doing:
require_once("DB.php");
// Testing PEAR DB for oracle
/**
* @global string $_DB_TYPE
*/
$_DB_TYPE = 'oci8';
/**
* @global mixed $_DSN
*/
$_DSN = array('phptype' => $_DB_TYPE,
'username' => 'usernamehere',
'password' => 'passwordhere',
'hostspec' => 'dsn_of_oracleclient'
);
/**
* @global mixed $_DBH
*/
$_DBH = null;
$_DBH = DB::connect($_DSN);
if (DB::isError($_DBH)) {
echo "\n Error: Not able to connect to Oracle using PEAR DB";
var_dump( $_DBH->getCode());
var_dump($_DBH->getMessage());
var_dump($_DBH->getUserInfo());
var_dump($_DBH->getDebugInfo());
} else {
echo "\n Success: connected to Oracle using PEAR DB";
}
// second method
$db = DB::connect("oci8://username:password@dsn");
if (DB::isError($db)) {
var_dump($error_code);
var_dump($db->getMessage());
var_dump($db->getUserInfo());
var_dump($db->getDebugInfo());
}
P.S: I am able to interact with oracle using oci_connet(). BTW, I am using macosx machine.
Thanks in advance.