ID: 32099 User updated by: terryoh at wins21 dot com Reported By: terryoh at wins21 dot com -Status: Feedback +Status: Open Bug Type: COM related Operating System: win32 PHP Version: 4CVS-2005-02-28 New Comment:
In my test, PHP 5 has same problem. I really want to know the solution, please.. Previous Comments: ------------------------------------------------------------------------ [2005-03-02 08:23:50] [EMAIL PROTECTED] Please try using this CVS snapshot: http://snaps.php.net/php5-latest.tar.gz For Windows: http://snaps.php.net/win32/php5-win32-latest.zip This is PHP 5 snapshot which has better COM support. ------------------------------------------------------------------------ [2005-02-28 02:43:18] terryoh at wins21 dot com I downloaded the latest php. http://snaps.php.net/win32/php4-win32-STABLE-latest.zip After upgrading the php module, I tried the same test. But the result was same. Memory and the count of the handles were increased. After the session.gc_maxlifetime(php.ini), the result was same. [Presumption] I read something about zend engine on a webpage(I can't remeber the web address exactly), it is that the zend engine doesn't release database connection to reuse exceptionally. It might be this process causes trouble between ADO and Zend engine. ------------------------------------------------------------------------ [2005-02-25 14:20:25] [EMAIL PROTECTED] 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 ------------------------------------------------------------------------ [2005-02-25 01:52:36] terryoh at wins21 dot com Description: ------------ Today, my apache server stopped service. So I tested whether the apache daemon was ok or not. It worked, because the telnet 80 connection(like C:/telnet.exe 127.0.0.1 80) was successful. But I could not open any php pages on the internet explorer. I checked the memory with windows task manager and I found something strange. The allocated memory for apache was almost 1GB(998MB) and the count of the handles was almost 40000(39890). Finally I found that it was ADO-PHP problem. I could see memory and the count of handles increased when opening database and closing it repeatedly(1 try/1 second for an hour). Especially the handles were never decreased. [Steps] 1) Register any ODBC DSN(driver=SQL Server)in the control panel. 2) In PHP.INI, set the key name(odbc.default_db) with the DSN;user ID;password. 3) Start an apache service. 4) Open a test page(in the reproduce code section)in your web browser. 5) Refresh the test page repeatedly once a second. 6) Open windows task manager. If you can not see handle column on the process tab, add it(Menu->View->Column Selection->Handle). 7) After 1 minute or later, you can see the count of apache handle increase like 400->401->402->403.... Also you can see the memory increase. Reproduce code: --------------- <?php $ConnectionString = ini_get('odbc.default_db'); $AdoConn = new COM("ADODB.Connection"); $AdoConn->Open($ConnectionString); $AdoConn->Close(); unset($AdoConn); ?> ***** Web Server : Apache 1.3.28 ***** PHP : 4.3.8 ***** OS : Windows 2000 Server ***** DBMS : MSSQL2000 Enterprise Edition ***** OTHERS : MDAC 2.8 Expected result: ---------------- Windows Task Manager(Process Tab) Image name Memory Handle Apache.exe 10,840KB 200 11:00 AM Apache.exe 10,857KB 201 11:02 AM Apache.exe 10,867KB 202 11:04 AM Apache.exe 10,867KB 202 11:06 AM Apache.exe 10,867KB 202 11:08 AM Apache.exe 10,867KB 202 11:10 AM Apache.exe 10,867KB 202 11:12 AM .... Actual result: -------------- Windows Task Manager(Process Tab) Image name Memory Handle Apache.exe 10,840KB 200 11:00 AM Apache.exe 10,857KB 201 11:02 AM Apache.exe 10,867KB 202 11:04 AM Apache.exe 10,877KB 203 11:06 AM Apache.exe 10,886KB 204 11:08 AM Apache.exe 10,899KB 205 11:10 AM Apache.exe 10,910KB 206 11:12 AM .... Apache.exe 998MB 39890 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=32099&edit=1