Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> PHP and Oracle 8i
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