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!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

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

dvohra21
Please refer
http://www.regdeveloper.co.uk/2008/02/22/mvc_php_framework_zend/
595528
hi, i've look at the article but it don't explain about PDO but using MVC and the Oracle Adapter, from my own research, the problem i have comes from Oracle installation or the PDO_OCI package, because when i try from 2 different workstation with different OS and having their own apache and php ENV it will work, it won't work on the oracle database host :/
1 - 2
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,603 views