Oracle + PDO + Zend Framework
595528Apr 21 2008 — edited Apr 28 2008Hello everyone,
I am trying to connect to an Oracle database thru php PDO using the Zend_Db from Zend Framework, but i have a connection error stating that i use incorect handle
the server platform is Linux
The database software is 10G2 (enterprise edition)
PHP version is 5.2.5
oracle SID is web02prd
PHP code for connect :
public static function setDb(){
$options = array ( Zend_Db::CASE_FOLDING => Zend_Db::CASE_UPPER);
$params = array ('username' => 'user',
'password' => 'pass',
'dbname' => 'web02prd',
'options' => $options);
try{
$db = Zend_Db::factory("PDO_OCI",$params);
$db->getConnection();
return $db;
}catch(Zend_Db_Adapter_Exception $e){
echo $e->getMessage();
Zend_Debug::dump($db);
}
}
and the error is :
SQLSTATE[]: pdo_oci_handle_factory: OCI_INVALID_HANDLE (/usr/src/PDO_OCI/oci_driver.c:463)
pdo and PDO_OCI are listed when i type php -m in command line