Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> PHP and Oracle 8i

PHP and Oracle 8i

From: Ivo Jansch <ivo_at_ibuildings.nl>
Date: Fri, 24 Mar 2000 13:42:22 +0100
Message-ID: <38DB62AE.CBD5C7D3@ibuildings.nl>


Hello,

we're trying to use PHP (4 beta, patchlevel 1) to connect to our oracle 8i (8.1.5) database. Both are running on the same machine, a Redhat Linux 6.1 box.

The code we used:

<?

putenv("ORACLE_HOME=/usr/local/oracle/8i/u01/app/oracle/product/8.1.5");  putenv("ORACLE_SID=test");

putenv("TWO_TASK=/usr/local/oracle/8i/u01/app/oracle/product/8.1.5/network/admin");

 $c1 = OCIlogon("scott","tiger","test");

 print OCIServerVersion($c1);
 print "<br>";

 $query = "select name from customer";
 $stmt = ociparse($c1,$query);
 ociexecute($stmt);

 ocifetchinto($stmt,&$result,OCI_NUM);
 $all = sizeof($result);

 for($i=0;$i<$all;$i++) {
  print $result[$i];
  print "<br>";
 }
 ocilogoff($c1);
?>

When I run this code, I get the following error:

Warning: OCIStmtExecute: ORA-03106: fatal two-task communication protocol error in /var/www/test/index.php3 on line 13

Now the strange thing is, if I select a numeric field from the database, like customerid, it works fine!!

I checked a few things:
- If I execute the same query, "select name from customer", in for example sqlplus, it works fine.
- The TWO_TASK variable that is set at the start of the file contains a correct tnsnames.ora file.

Anyone any idea what's wrong here?

Greetings,
Ivo Received on Fri Mar 24 2000 - 06:42:22 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US