Problem with PHP OCI extension and Oracle connection

Written by on November 20, 2005 in General - 4 Comments

Recently I had a serious problem with PHP OCI extension and Oracle. I have written many applications running from the same box and connection to the same Oracle database and all of them was working fine excepting this one.

The connection work successfully, but when the scripts execture the query it fails and return this warning :

Warning: ociexecute(): OCIStmtExecute: ORA-03114: not connected to ORACLE in /usr/local/apache/htdocs/script.php on line 152

There was no high load on the Oracle server, and the problem is that the same code sometimes work and sometimes not. In the Oracle manual I found that the error ORA-03114 mean that there was problem in connection between the two servers. The network have been tested, everything was perfect.

In the mean time I solved the problem by saving the failed queries in a mysql database, and with a cron check every 5 minutes to run again these queries. But I don’t think it could solve the problem in the long time.

4 Comments on "Problem with PHP OCI extension and Oracle connection"

  1. cj November 20, 2005 at 7:09 pm · Reply

    Get the refactored OCI8 driver, which was rearchitected for stability and had many bug fixes. You can get it from or
    If you still have problems, post to Oracle’s OTN forum.
    – cj

  2. Hatem November 20, 2005 at 8:11 pm · Reply

    I had always to compile if I have to change the OCI extension. I’ve PHP running on a sun solaris OS. changing the extension would be my last choice because it was working fine before. thx anyway

  3. William Lovaton April 6, 2010 at 2:52 pm · Reply

    Hello there, did you find the solution to this problem? I’m having the same problem with Red Hat Enterprise Linux and PHP 4.3.9.

  4. soulemane April 26, 2010 at 2:49 pm · Reply

    Hi ,
    Please Sir ,
    I ‘m trying longtime ago(1 month) to connect oracle with php in linux without success .I have done all my best without success but i don’t want to give up …
    I have tried many method and tutorial from the internet some time with zend …
    PLease can you just suggest me any easy to do it. This will count for my final year project in web technology ….
    My configuration:
    redhat 5.3 (its php and httpd version)
    oracle xe 10

Leave a Comment