php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #28680 Warning: ociexecute(): OCIStmtExecute: ORA-03106: fatal two-task
Submitted: 2004-06-07 20:30 UTC Modified: 2004-06-09 08:13 UTC
From: prichter at rci dot rutgers dot edu Assigned:
Status: Not a bug Package: OCI8 related
PHP Version: 4.3.6 OS: Red Hat Enterprise Linux 3.0 AS
Private report: No CVE-ID: None
 [2004-06-07 20:30 UTC] prichter at rci dot rutgers dot edu
Description:
------------
When I try to run a query, in PHP using OCIExecute, for values of datatype
VARCHAR2, I get the following error:
        "Warning: ociexecute(): OCIStmtExecute: ORA-03106: fatal two-task
communication protocol error in /usr/local/apache2/htdocs/index.php on line
16". When I query for numbers it works fine as long as I use the TO_NUMBER
conversion in the query.

I'm currently running Red Hat Enterprise Linux 3.0 AS, Apache 2.0.49, PHP
4.3.6, and Oracle 9.2.0.4 Client. I'm trying to connect to an Oracle 8.1.7.0
server on a Windows 2000 box. Here are my settings and configurations:

1. I can connect the Oracle client to the server via SQL*Plus. Therefore,
sqlnet.ora and tnsnames.ora are set correctly and the databases are
compatible, at least for use with SQL*Plus.

2. I made sure that the Oracle Call Interface was installed with the Oracle
9i client.

3. PHP was configured with the following parameters:
        ./configure --with-mysql --with-oracle --with-oci8 --with-apxs2=<dir to
apxs>

4. My environmental variables are set in /usr/local/apache2/bin/apachectl
the following ways:
        LD_LIBRARY_PATH=/u01/app/oracle/lib:/usr/local/apache2/lib
        ORACLE_SID=oracledb
        ORACLE_BASE=/u01/app/oracle
        ORACLE_HOME=/u01/app/oracle
        TNS_ADMIN=/u01/app/oracle/network/admin
        TWO_TASK=/u01/app/oracle/network/admin
        NLS_LANG=AMERICAN_AMERICA.WE8ISO8859P1 (this matches the server setting)
        ORA_NLS33=/u01/app/oracle/ocommon/nls/admin/data
        LD_PRELOAD=/u01/app/oracle/lib/libclntsh.so.9.0


Reproduce code:
---------------
<?php
PutEnv("ORACLE_SID=oracledb");
PutEnv("ORACLE_HOME=/u01/app/oracle");
PutEnv("TNS_ADMIN=/u01/app/oracle/network/admin");

$user = "sys";
$pw = <the db pw>;
$tns = "HHH";
if ($c=OCILogon($user, $pw, $tns)) {
  echo "Successfully connected to Oracle.\n";

  $s = OCIParse($c, "SELECT FIRSTNAME AS FIRSTNAME FROM OHCS.STUDENT");
  OCIExecute($s, OCI_DEFAULT);
  while (OCIFetch($s)) {
    echo "FIRSTNAME=" . ociresult($s, "FIRSTNAME") . "\n";
  }
  OCILogoff($c);
} else {
  $err = OCIError();
  echo "Oracle Connect Error " . $err[text];
}
?>



Expected result:
----------------
A simple list of all the first names in this table (OHCS.STUDENT). This is just a test.

Actual result:
--------------
Warning: ociexecute(): OCIStmtExecute: ORA-03106: fatal two-task communication protocol error in /usr/local/apache2/htdocs/index.php on line
16

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-06-08 08:52 UTC] tony2001@php.net
Try to connect to Oracle server using SQLPlus AND to execute the same query.
Imo the problem is in your client, which is too new, comparing with version of server.
Btw, putenv() doesn't help much, 'cos appropriate variables should be visible to OCI libs before they got initialized.

 [2004-06-08 22:14 UTC] prichter at rci dot rutgers dot edu
I installed the 8.1.7.0 client and eveything worked fine. Thank you for the reply.
 [2004-06-09 08:13 UTC] tony2001@php.net
Ok, so the problem was in OCI indeed..
Not a PHP bug -> bogus.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 25 11:01:30 2024 UTC