Apache / PHP / ODBC / Oracle disconnect problems

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I am hoping someone maybe has come across this problem before as it is
driving me up the wall!

My web server is RH 7.3 / Apache 1.3.27 / PHP 4.1.3 / unixODBC 2.2.0 /
ODBC dirve 0.5.1 (ex of Easysoft)

When the web site accesses the database it connects correctly fetchs the
data and then closes - only it leaves the connection open. Oracle reports
no sessions, but the oputput from netstat -a show the connections as
'Established', and you can see the session processes on the Oracle server.
When the apache server is restarted these connections disappear. Of course
as soon as oracle reaches it's limit of connections it freezes the web 
site.

I have tried PHP 4.2.3 / Apache 2 / unixODBC 2.2.5 in all cobinations, but
still get the same problem.

I am trying 4.3.2, but I am having trouble compiling with odbc support,
although it is enabled I get Call to undefined errors for the odbc_connect.

The oracle database is on a seperate Solaris server and is 8.1.7.

The connection is closed in PHP using odbc_close().

This is the script we are using to test :
?>
set_time_limit(0);

// Change these vars
putenv("TWO_TASK=dev02");
putenv("ORACLE_SID=dev02");
putenv("ORACLE_HOME=/www/oraclient");
putenv("ODBCINSTINI=/usr/local/etc/odbcinst.ini");
putenv("ODBCINI=/usr/local/etc/odbc.ini");
$counter=0;
$loop = true;

while($loop){

        $counter++;
        sleep(1);
        echo "Counting... $counter "; flush();
        $test = odbc_connect("dev02", "username", "passsword", 
		SQL_CUR_USE_DRIVER);
        echo "Resource Identifier... $test<br>\n"; flush();
        odbc_close($test);
        unset($test);
        echo "Closed<BR>"; flush();

    ($counter > 1) ? $loop = false : $loop = true;
}
?>

Can anyone shed light on what I am doing wrong?

Many thanks,

Neil.


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux