Skip to Main Content

DevOps, CI/CD and Automation

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Oracle + PDO + Zend Framework

595528Apr 21 2008 — edited Apr 28 2008
Hello 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
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 26 2008
Added on Apr 21 2008
2 comments
5,688 views