ID: 24003
Updated by: sniper@php.net
Reported By: dkruger at stevens-tech dot edu
-Status: Open
+Status: Feedback
Bug Type: OCI8 related
Operating System: Redhat 8.0
PHP Version: 4.3.2
New Comment:
Please try using this CVS snapshot:
http://snaps.php.net/php4-STABLE-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php4-win32-STABLE-latest.zip
Previous Comments:
------------------------------------------------------------------------
[2003-06-03 17:16:07] dkruger at stevens-tech dot edu
The following code used to work on Oracle 8.0 on Solaris.
Now, under Redhat 8.0 and Oracle 9i, when you run it several times in a
row, it eventually seg faults and the only way to re-establish the
connection is by restarting apache.
Our PHP is built with
./configure --prefix=usr/local/php --with-gd=/usr/local
--with-png-dir=/usr/local --with-oci8=/oracle
--with-apx2=/usr/local/apache/bin/apxs --with-jpeg-dir=/usr
--with-zlib-dir=/usr --with-xpm-dir=/usr --enable-debug
--enable-sigchild
This is not my code, and I do not use PHP, so I want to know first if
there is a better way of writing this code. Can it successfully recover
given that it dies for some reason on a query? Is there any more
recoverable way of writing it?
Even if it's not optimal code, it should be slightly more recoverable
than this.
print "Test";
putenv("ORACLE_SID=coastal");
putenv("ORACLE_HOME=/oracle");
putenv("TNS_ADMIN=/oracle/network/admin/tnsnames.ora");
$connection = OCILogon("user","xxx", "mydb") or
die("Couldn't
logon.");
$sql = "select count(*) from x";
$sql_statement = OCIParse($connection,$sql) or die("Couldn't parse
statement.");
OCIExecute($sql_statement, OCI_DEFAULT) or die("Couldn't execute
statement.");
$num_columns = OCINumCols($sql_statement);
OCIFreeStatement($sql_statement);
OCILogoff($connection);
PHP still runs after this code, as long as the page does not involve
any other Oracle interaction.
thanks!
Dov
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=24003&edit=1