[PHP-users 7130] PHP とオラクル9i の問題

Takeshi Amano php-users@php.gr.jp
Wed, 24 Apr 2002 20:08:43 +0900


This is a multi-part message in MIME format.

------=_NextPart_000_002A_01C1EBCB.D58F47B0
Content-Type: text/plain;
	charset="iso-2022-jp"
Content-Transfer-Encoding: 7bit

こんにちはいつも参考にさせていただいています。

先日Linux 上で走っているオラクル9i に接続をしてクエリを出してみたのですが
うまくつながりません。以下にコード等を載せますのでご教授いただければ。

環境
PC Duron700Mhz + 256M memory
Redhat 7.2
Oracle 9i
PHP Version 4.4.4 with configure options
 './configure' '--with-apxs' '--enable-magic-quotes' '--with-ldap'
'--enable-mbstring' '--with-pgsql' '--with-oci8=/opt/oracle/product/9.0.1'

コード
<?php
$user = "****";
$pass = "****";
$db_name = "test_localhost";

putenv("ORACLE_HOME=/opt/oracle/product/9.0.1");

$conn = OCILogon($user, $pass, $db_name);

echo $conn;

$qry = "SELECT * FROM landlord";

$res = OCIParse($conn, $qry);

OCIExecute($res);

while (OCIFetchInto($res, &$arrAme)) {
  print_r($arrAme);
}

?>

結果
Resource id #3
Warning: OCIStmtExecute: ORA-00255: error archiving log %s of thread %s,
sequence # %s in /var/www/html/oracle/oracletest.php on line 21

Warning: OCIFetchInto: ORA-24374: define not done before fetch or execute
and fetch in /var/www/html/oracle/oracletest.php on line 23

この結果を見る限り、接続はしているようなのですがそこから先がうまくいっていな
いようです。

よろしくお願いします。

天野

------=_NextPart_000_002A_01C1EBCB.D58F47B0
Content-Type: text/html;
	charset="iso-2022-jp"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-2022-jp">
<META content=3D"MSHTML 6.00.2715.400" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT face=3D"MS UI Gothic" =
size=3D2>=1B$B$3$s$K$A$O$$$D$b;29M$K$5$;$F$$$?$@$$$F$$$^$9!#=1B(B</FONT><=
/DIV>
<DIV><FONT face=3D"MS UI Gothic" size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3D"MS UI Gothic" =
size=3D2>=1B$B@hF|=1B(BLinux&nbsp;=1B$B>e$GAv$C$F$$$k%*%i%/%k=1B(B9i=20
=1B$B$K@\B3$r$7$F%/%(%j$r=3DP$7$F$_$?$N$G$9$,=1B(B</FONT></DIV>
<DIV><FONT face=3D"MS UI Gothic"=20
size=3D2>=1B$B$&$^$/$D$J$,$j$^$;$s!#0J2<$K%3!<%IEy$r:\$;$^$9$N$G$465<x$$$=
?$@$1$l$P!#=1B(B</FONT></DIV>
<DIV><FONT face=3D"MS UI Gothic" size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3D"MS UI Gothic" size=3D2>=1B$B4D6-=1B(B</FONT></DIV>
<DIV><FONT face=3D"MS UI Gothic" size=3D2>PC Duron700Mhz + 256M =
memory</FONT></DIV>
<DIV><FONT face=3D"MS UI Gothic" size=3D2>Redhat 7.2</FONT></DIV>
<DIV><FONT face=3D"MS UI Gothic" size=3D2>Oracle 9i</FONT></DIV>
<DIV><FONT face=3D"MS UI Gothic" size=3D2>PHP Version 4.4.4 with =
configure=20
options</FONT></DIV>
<DIV><FONT face=3D"MS UI Gothic" size=3D2><FONT =
size=3D3>&nbsp;'./configure'=20
'--with-apxs' '--enable-magic-quotes' '--with-ldap' '--enable-mbstring'=20
'--with-pgsql' =
'--with-oci8=3D/opt/oracle/product/9.0.1'</FONT></FONT></DIV>
<DIV><FONT face=3D"MS UI Gothic" size=3D2><FONT =
size=3D3></FONT></FONT>&nbsp;</DIV>
<DIV><FONT face=3D"MS UI Gothic" size=3D2><FONT =
size=3D3>=1B$B%3!<%I=1B(B</FONT></FONT></DIV>
<DIV><FONT face=3D"MS UI Gothic">&lt;?php</FONT></DIV>
<DIV><FONT face=3D"MS UI Gothic" size=3D2>$user =3D "****";<BR>$pass =3D =

"****";<BR>$db_name =3D "test_localhost";</FONT></DIV>
<DIV><FONT face=3D"MS UI Gothic" size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3D"MS UI Gothic"=20
size=3D2>putenv("ORACLE_HOME=3D/opt/oracle/product/9.0.1");</FONT></DIV>
<DIV><FONT face=3D"MS UI Gothic" size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3D"MS UI Gothic" size=3D2>$conn =3D OCILogon($user, =
$pass,=20
$db_name);</FONT></DIV>
<DIV><FONT face=3D"MS UI Gothic" size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3D"MS UI Gothic" size=3D2>echo $conn;</FONT></DIV>
<DIV><FONT face=3D"MS UI Gothic" size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3D"MS UI Gothic" size=3D2>$qry =3D "SELECT * FROM=20
landlord";</FONT></DIV>
<DIV><FONT face=3D"MS UI Gothic" size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3D"MS UI Gothic" size=3D2>$res =3D OCIParse($conn, =
$qry);</FONT></DIV>
<DIV><FONT face=3D"MS UI Gothic" size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3D"MS UI Gothic" size=3D2>OCIExecute($res);</FONT></DIV>
<DIV><FONT face=3D"MS UI Gothic" size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3D"MS UI Gothic" size=3D2>while (OCIFetchInto($res, =
&amp;$arrAme))=20
{<BR>&nbsp; print_r($arrAme);<BR>}</FONT></DIV>
<DIV><FONT face=3D"MS UI Gothic" size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3D"MS UI Gothic" size=3D2>?&gt;</FONT></DIV>
<DIV><FONT face=3D"MS UI Gothic" size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3D"MS UI Gothic" size=3D2>=1B$B7k2L=1B(B</FONT></DIV>
<DIV><FONT face=3D"MS UI Gothic" size=3D2><FONT size=3D3>Resource id=20
#3<BR><B>Warning</B>: OCIStmtExecute: ORA-00255: error archiving log %s =
of=20
thread %s, sequence # %s in <B>/var/www/html/oracle/oracletest.php</B> =
on line=20
<B>21</B><BR><BR><B>Warning</B>: OCIFetchInto: ORA-24374: define not =
done before=20
fetch or execute and fetch in <B>/var/www/html/oracle/oracletest.php</B> =
on line=20
<B>23</B><BR></FONT></FONT></DIV>
<DIV><FONT face=3D"MS UI Gothic" size=3D2><FONT=20
size=3D3>=1B$B$3$N7k2L$r8+$k8B$j!"@\B3$O$7$F$$$k$h$&$J$N$G$9$,$=3D$3$+$i@=
h$,$&$^$/$$$C$F$$$J$$$h$&$G$9!#=1B(B</FONT></FONT></DIV>
<DIV><FONT face=3D"MS UI Gothic"></FONT>&nbsp;</DIV>
<DIV><FONT face=3D"MS UI Gothic"><FONT =
size=3D2>=1B$B$h$m$7$/$*4j$$$7$^$9!#=1B(B</FONT></FONT></DIV>
<DIV><FONT face=3D"MS UI Gothic"><FONT =
size=3D2></FONT></FONT>&nbsp;</DIV>
<DIV><FONT face=3D"MS UI Gothic"><FONT=20
size=3D2>=1B$BE7Ln=1B(B<FONT></DIV></FONT></FONT></FONT></BODY></HTML>

------=_NextPart_000_002A_01C1EBCB.D58F47B0--