From:             dkruger at stevens-tech dot edu
Operating system: Redhat 8.0
PHP version:      4.3.2
PHP Bug Type:     OCI8 related
Bug description:  after several connections to Oracle 9i, program dies

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 bug report at http://bugs.php.net/?id=24003&edit=1
-- 
Try a CVS snapshot:         http://bugs.php.net/fix.php?id=24003&r=trysnapshot
Fixed in CVS:               http://bugs.php.net/fix.php?id=24003&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=24003&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=24003&r=needtrace
Try newer version:          http://bugs.php.net/fix.php?id=24003&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=24003&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=24003&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=24003&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=24003&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=24003&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=24003&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=24003&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=24003&r=isapi
Install GNU Sed:            http://bugs.php.net/fix.php?id=24003&r=gnused

Reply via email to