ID: 29074 Comment by: phpbugreport at workboy dot com Reported By: david dot blair at nsi1 dot com Status: Open Bug Type: MSSQL related Operating System: MS 2003 PHP Version: 4.3.7 New Comment:
This bug should probably be closed. The problem is on the MSSQL end and ban be resolved by changing the value of the winsocklistenbacklog registry entry. For those who are experiencing this problem, please see http://support.microsoft.com/default.aspx?kbid=328476 I don't know why this also affects mssql_select_db, but they do appear to go together. Previous Comments: ------------------------------------------------------------------------ [2004-09-13 00:42:39] phpbugreport at workboy dot com Upgrading seems to make things worse. I upgraded to freetds-0.62.4, php-4.3.9RC2 (4.3.8 has a compile issue with freetds-0.62.4 according to bug reports), and apache 1.3.31. Now in addition to mssql_connect failures I also get mssql_select_db failures for one of our busier databases. Could it be that php/freetds is getting too fast and giving up before a response is received from SQL 2000? Charles Bennigton Oddcast, Inc. ------------------------------------------------------------------------ [2004-09-11 22:13:08] phpbugreport at workboy dot com We are currently running apache_1.3.28, freetds-0.61.2 and php-4.3.3 on linux 2.4.x kernels and experiencing the same problem connecting to a SQL 2000E SP3 database. Modifying our PHP db connection classes to immediately try mssql_connect again when it fails produces the desired results most of the time. However not always. I will be upgrading to the latest and greatest in the current major version for all of the components on the Linux side and testing more. I will post a follow up then. Charles Bennington Oddcast, Inc. ------------------------------------------------------------------------ [2004-08-31 16:13:34] david dot blair at nsi1 dot com I've never had Apache hang before but I'm also not running through TDS. I just tried upgrading the production server to 5.0.1 last night. I've been running 5.0.0 on the development server and 5.0.1 on my laptop for two weeks/one week with no problems. The database connection failed 6 times last night after we brought everything back up. After 2 more failures this morning I rolled everything back. Oh hell, I just remembered I left php_mssql.dll from the 5.0.1 build in the windows directory...I think I'm going to leave it in there and see what happens...two of us have tested the system with no crashes so far... More info as it comes in... ------------------------------------------------------------------------ [2004-08-27 01:43:36] jochen dot daum at cabletalk dot co dot nz Hi, I have the same experience with mssql_select_db. I use PHP 4.3.2 as a module with FreeTDS. The mssql extension is patched though with a datetime extension that reads the milliseconds as well (as mentioned in some early bugs) The problem does not seem to occur with heavy load, but after a certain amount of mssql_select_db. According to the documentation: "In case a second call is made to mssql_connect() with the same arguments, no new link will be established, but instead, the link identifier of the already opened link will be returned." (mssql_connect) and "Every subsequent call to mssql_query() will be made on the active database." (mssql_select_db) I have modified my database access layer to call mssql_select_db() before each mssql_query(). After a number of mssql_select_db, I get an instant failure. Retrying helps for some more queries, but then the process hangs with Apache running at 100%. HTH, Jochen ------------------------------------------------------------------------ [2004-07-26 16:14:25] david dot blair at nsi1 dot com I should probably note that fmk and I have exchanged 2 emails outside of this bug report (just so it's part of this paper trail). He brought me up to speed on the thread safety issues of the dblib library. This next part can be taken with a grain of salt. I'm not sure if it's a seperate issue or something that will help fmk in debugging...I upgraded our development server to PHP 5. It's still showing the intermittent problems of the failed connection, but it's not happening at mssql_connect. It happens at mssql_select_db. The error that's returned is: Warning: mssql_select_db() [function.mssql-select-db]: Unable to select database: blah blah blah... I dunno fmk if you made a fix in the 5 version that's not present in the 4.3.7 version? Wondering if you created some magic code that fixes the mssql_connect issue that needs to be applied to the other mssql functions... DB ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/29074 -- Edit this bug report at http://bugs.php.net/?id=29074&edit=1