php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #14024 can't do select on char, varchar2 etc. variables with oracle 9i
Submitted: 2001-11-12 02:30 UTC Modified: 2002-05-27 17:13 UTC
Votes:2
Avg. Score:5.0 ± 0.0
Reproduced:2 of 2 (100.0%)
Same Version:1 (50.0%)
Same OS:2 (100.0%)
From: Andrew dot Karadimov at bulpost dot com Assigned:
Status: Closed Package: OCI8 related
PHP Version: 4.0.6 OS: linux;kernel-2.4.x
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: Andrew dot Karadimov at bulpost dot com
New email:
PHP Version: OS:

 

 [2001-11-12 02:30 UTC] Andrew dot Karadimov at bulpost dot com
After execution of the script bellow and any other script 
the php4 return:
Warning: OCIStmtExecute: ORA-03106: fatal two-task 
communication protocol error in 
/var/www/admin/sqlexecute.phtml on line 45
// line 45 is: ociexecute($stmt,OCI_DEFAULT);

putenv("ORACLE_SID=ORCL");
putenv("ORACLE_HOME=/home/oracle/u01/oracle/product/9.0.1");
putenv("LD_LIBRARY_PATH=/home/oracle/u01/oracle/product/9.0.1/lib");
$conn=OCIlogon ($usrname, $pass, "");
$Oerror=OCIError($conn);
$column_name[64];
if ($Oerror==false){
        $stmt = ociparse($conn,$sqlstring);
        ociexecute($stmt,OCI_DEFAULT);
        $Oerror=OCIError($conn);
        if ($Oerror==false){
                $ncols = OCINumCols($stmt);
                if ((int)$ncols==0){
                        OCIError($stmt);
                        OCIFreeStatement($stmt);
                        OCICommit($conn);
                        OCIlogoff($conn);
                        echo("Done.");
                        return;
                }
                echo("<table border='0'><tr>");
                for ( $i = 1; $i <= $ncols; $i++ ) {
                $column_name[$i]  = 
OCIColumnName($stmt,$i);
                echo("<td>$column_name[$i]</td>");}
                echo("</tr>");
                while (ocifetch($stmt)){
                for ( $i = 1; $i <= $ncols; $i++ ) {
              		   
echo("<td>".ociresult($stmt,$column_name[$i])."</td>");}
                echo("</tr>");
                }
                echo("</table>");
        }
        OCIError($stmt);
        OCIFreeStatement($stmt);
        OCICommit($conn);
        OCIlogoff($conn);
}


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-04-13 08:58 UTC] thies@php.net
set the oracle env vars _before_ you start apache. PutEnv will not work.

 [2002-05-27 14:47 UTC] bomek at egeolog dot com
This should be documented... I've lost countless hours on this problem ;-)
 [2002-05-27 17:13 UTC] mfischer@php.net
http://www.php.net/manual/en/ref.oci8.php:

"ORACLE_HOME

ORACLE_SID

LD_PRELOAD

LD_LIBRARY_PATH

NLS_LANG

ORA_NLS33

After setting up the environment variables for your webserver user, ..."

It can't be any clearer.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sun Jan 05 06:01:27 2025 UTC