|
View:
New views
11 Messages
—
Rating Filter:
Alert me
|
|
|
Error with PDO_OCI (Invalid handle)Hi everyone, i am having an issue with PDO_OCI and eventhough i have been posting on several forums, oracle otn included, i still cannot have any answer, so i would like to know if any of you got the same error and how to solve it.
My situation is a Linux server, with apache 2 and php5.2.5 and also the Oracle database. While trying to create my hand thru the factory method, i get this error message : SQLSTATE[]: pdo_oci_handle_factory: OCI_INVALID_HANDLE my code for connecting to database is : public static function setDb(){ $options = array ( Zend_Db::CASE_FOLDING => Zend_Db::CASE_UPPER); $params = array ( 'username' => 'myuser', 'password' => 'mypass', '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); } } Note that oci8 work properly, |
|
|
RE: Error with PDO_OCI (Invalid handle)Do you need features supported only by pdo_oci?
The pdo_oci extension is still experimental and has many bugs. I've had significant problems with the pdo_oci extension, including random crashes on my windows development system. I had to work around some table/column case issues (which can be solved in oracle itself). However, once resolved, I was able to use the oci8 extension and its corresponding Zend_Db adapter with great success. Kevin Hallmark -----Original Message----- From: jeromekbe [mailto:j.kaluza@...] Sent: Friday, June 13, 2008 5:10 AM To: fw-db@... Subject: [fw-db] Error with PDO_OCI (Invalid handle) Hi everyone, i am having an issue with PDO_OCI and eventhough i have been posting on several forums, oracle otn included, i still cannot have any answer, so i would like to know if any of you got the same error and how to solve it. My situation is a Linux server, with apache 2 and php5.2.5 and also the Oracle database. While trying to create my hand thru the factory method, i get this error message : SQLSTATE[]: pdo_oci_handle_factory: OCI_INVALID_HANDLE my code for connecting to database is : public static function setDb(){ $options = array ( Zend_Db::CASE_FOLDING => Zend_Db::CASE_UPPER); $params = array ( 'username' => 'myuser', 'password' => 'mypass', '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); } } Note that oci8 work properly, -- View this message in context: http://www.nabble.com/Error-with-PDO_OCI-%28Invalid-handle%29-tp17819374 p17819374.html Sent from the Zend DB mailing list archive at Nabble.com. |
|
|
RE: Error with PDO_OCI (Invalid handle)According to Chris Jones, there should be no reason why you should be
using PDO_OCI at this point in its development lifecycle. Here is an amazing resource I use ( being a novice oracle developer as well ), which has provided numerous assistance. http://www.oracle.com/technology/tech/php/pdf/underground-php-oracle-man ual.pdf You'll need to open a free oracle account, but it's completely worth it. 195 pages of Christopher Jones' brain. Goes into great length over every driver, every function call, and every possible concept surrounding oracle and php. Surprisingly though, I'm getting no results found for this error :) Go figure. -----Original Message----- From: Kevin Hallmark [mailto:Kevin.Hallmark@...] Sent: Friday, June 13, 2008 6:39 AM To: jeromekbe; fw-db@... Subject: RE: [fw-db] Error with PDO_OCI (Invalid handle) Do you need features supported only by pdo_oci? The pdo_oci extension is still experimental and has many bugs. I've had significant problems with the pdo_oci extension, including random crashes on my windows development system. I had to work around some table/column case issues (which can be solved in oracle itself). However, once resolved, I was able to use the oci8 extension and its corresponding Zend_Db adapter with great success. Kevin Hallmark -----Original Message----- From: jeromekbe [mailto:j.kaluza@...] Sent: Friday, June 13, 2008 5:10 AM To: fw-db@... Subject: [fw-db] Error with PDO_OCI (Invalid handle) Hi everyone, i am having an issue with PDO_OCI and eventhough i have been posting on several forums, oracle otn included, i still cannot have any answer, so i would like to know if any of you got the same error and how to solve it. My situation is a Linux server, with apache 2 and php5.2.5 and also the Oracle database. While trying to create my hand thru the factory method, i get this error message : SQLSTATE[]: pdo_oci_handle_factory: OCI_INVALID_HANDLE my code for connecting to database is : public static function setDb(){ $options = array ( Zend_Db::CASE_FOLDING => Zend_Db::CASE_UPPER); $params = array ( 'username' => 'myuser', 'password' => 'mypass', '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); } } Note that oci8 work properly, -- View this message in context: http://www.nabble.com/Error-with-PDO_OCI-%28Invalid-handle%29-tp17819374 p17819374.html Sent from the Zend DB mailing list archive at Nabble.com. |
|
|
Re: Error with PDO_OCI (Invalid handle)jeromekbe wrote:
> Hi everyone, i am having an issue with PDO_OCI and eventhough i have been > posting on several forums, oracle otn included, i still cannot have any > answer, so i would like to know if any of you got the same error and how to > solve it. > > My situation is a Linux server, with apache 2 and php5.2.5 and also the > Oracle database. > > While trying to create my hand thru the factory method, i get this error > message : > > SQLSTATE[]: pdo_oci_handle_factory: OCI_INVALID_HANDLE > > my code for connecting to database is : > > public static function setDb(){ > $options = array ( Zend_Db::CASE_FOLDING => Zend_Db::CASE_UPPER); > $params = array ( > 'username' => 'myuser', > 'password' => 'mypass', > '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); > } > } > > Note that oci8 work properly, > -Justin |
|
|
Re: Error with PDO_OCI (Invalid handle)
I tried to specify the host and port but it's still the same error, when i try the Zend_Db adapter Oracle to use oci8 but i get the message "Unknown Exception", if i use oci8 in a test file it's working, if i use PDO functions i will have message OCI_INVALID_HANDLE, does that mean i need to rewrite all my DAO classes and a connecting class with oci functions instead of using Zend Db ? |
|
|
RE: Error with PDO_OCI (Invalid handle)I do not see your Oracle SID, in your connection params, try something
like 'dbname' => 'web02prd' . '/' . $oracle_sid, If you are unsure what that is, open up a shell on your Oracle server and look for the environment variable ORACLE_SID. Craig Duncan -----Original Message----- From: jeromekbe [mailto:j.kaluza@...] Sent: Monday, June 16, 2008 8:02 AM To: fw-db@... Subject: Re: [fw-db] Error with PDO_OCI (Invalid handle) jeromekbe wrote: > > Hi everyone, i am having an issue with PDO_OCI and eventhough i have been > posting on several forums, oracle otn included, i still cannot have any > answer, so i would like to know if any of you got the same error and how > to solve it. > > My situation is a Linux server, with apache 2 and php5.2.5 and also the > Oracle database. > > While trying to create my hand thru the factory method, i get this error > message : > > SQLSTATE[]: pdo_oci_handle_factory: OCI_INVALID_HANDLE > > my code for connecting to database is : > > public static function setDb(){ > $options = array ( Zend_Db::CASE_FOLDING => Zend_Db::CASE_UPPER); > $params = array ( > 'username' => 'myuser', > 'password' => 'mypass', > '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); > } > } > > Note that oci8 work properly, > > I tried to specify the host and port but it's still the same error, when i try the Zend_Db adapter Oracle to use oci8 but i get the message "Unknown Exception", if i use oci8 in a test file it's working, if i use PDO functions i will have message OCI_INVALID_HANDLE, does that mean i need to rewrite all my DAO classes and a connecting class with oci functions instead of using Zend Db ? -- View this message in context: http://www.nabble.com/Error-with-PDO_OCI-%28Invalid-handle%29-tp17819374 p17863079.html Sent from the Zend DB mailing list archive at Nabble.com. |
|
|
RE: Error with PDO_OCI (Invalid handle)web02prd is the Oracle SID, apache php and oracle database are on the same host
|
|
|
RE: Error with PDO_OCI (Invalid handle)OK, then try
'dbname' => 'localhost/web02prd', If that does not work, you need to reexamine you setup. Craig Duncan -----Original Message----- From: jeromekbe [mailto:j.kaluza@...] Sent: Monday, June 16, 2008 10:14 AM To: fw-db@... Subject: RE: [fw-db] Error with PDO_OCI (Invalid handle) web02prd is the Oracle SID, apache php and oracle database are on the same host Duncan, Craig wrote: > > I do not see your Oracle SID, in your connection params, try something > like > > 'dbname' => 'web02prd' . '/' . $oracle_sid, > > If you are unsure what that is, open up a shell on your Oracle server > and look for the environment variable ORACLE_SID. > > Craig Duncan > -----Original Message----- > From: jeromekbe [mailto:j.kaluza@...] > Sent: Monday, June 16, 2008 8:02 AM > To: fw-db@... > Subject: Re: [fw-db] Error with PDO_OCI (Invalid handle) > > > > > jeromekbe wrote: >> >> Hi everyone, i am having an issue with PDO_OCI and eventhough i have > been >> posting on several forums, oracle otn included, i still cannot have > any >> answer, so i would like to know if any of you got the same error and > how >> to solve it. >> >> My situation is a Linux server, with apache 2 and php5.2.5 and also > the >> Oracle database. >> >> While trying to create my hand thru the factory method, i get this > error >> message : >> >> SQLSTATE[]: pdo_oci_handle_factory: OCI_INVALID_HANDLE >> >> my code for connecting to database is : >> >> public static function setDb(){ >> $options = array ( Zend_Db::CASE_FOLDING => > Zend_Db::CASE_UPPER); >> $params = array ( >> 'username' => 'myuser', >> 'password' => 'mypass', >> '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); >> } >> } >> >> Note that oci8 work properly, >> >> > > > I tried to specify the host and port but it's still the same error, > i > try the Zend_Db adapter Oracle to use oci8 but i get the message > "Unknown > Exception", if i use oci8 in a test file it's working, if i use PDO > functions i will have message OCI_INVALID_HANDLE, does that mean i need > to > rewrite all my DAO classes and a connecting class with oci functions > instead > of using Zend Db ? > -- > View this message in context: > http://www.nabble.com/Error-with-PDO_OCI-%28Invalid-handle%29-tp17819374 > p17863079.html > Sent from the Zend DB mailing list archive at Nabble.com. > > > > -- View this message in context: http://www.nabble.com/Error-with-PDO_OCI-%28Invalid-handle%29-tp17819374 p17865328.html Sent from the Zend DB mailing list archive at Nabble.com. |
|
|
RE: Error with PDO_OCI (Invalid handle)i have tried and still got OCI_INVALID_HANDLE for pdo_oci and unknow exception with Zend DB Oracle Adapter
I don't know what would be wrong in my setup, an old php app can connect to the database using adodb for php (using oci8)
|
|
|
Re: Error with PDO_OCI (Invalid handle)This usually happens when apache dosen't have the ORACLE_HOME variable
setup properly setup a test php file with <? phpinfo();
?> and check if you see ORACLE_HOME setup.
this is what I have on /etc/sysconfig/httpd export ORACLE_HOME=/u01/app/oracle/ product/10g_client
export ORACLE_SID=10g_client export TNS_ADMIN=/u01/app/oracle/product/10g_client/network/admin/tnsnames.ora and works fine, (RedHat ES 5) On Tue, Jun 17, 2008 at 4:50 AM, jeromekbe <j.kaluza@...> wrote:
|
|
|
Re: Error with PDO_OCI (Invalid handle)We have decided to move the database to our oracle real cluster application and it works fine,
however the easy naming is not compatible since u need to specify service name and instance name aswell. So right now i got a server with apache 2 and Oracle instant client to connect to another machine wich host the database Thanks for your messages to guide me through
|
| Free Forum Powered by Nabble | Forum Help |