php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #32253 Accessing MSSQL server crashes Apache
Submitted: 2005-03-09 14:41 UTC Modified: 2005-04-02 01:00 UTC
Votes:1
Avg. Score:3.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:0 (0.0%)
From: piotr at clickthinking dot com Assigned:
Status: No Feedback Package: MSSQL related
PHP Version: 4.3.10, 5.0.3 OS: Windows 2003/2000/XP
Private report: No CVE-ID: None
 [2005-03-09 14:41 UTC] piotr at clickthinking dot com
Description:
------------
I have checked this with PHP 4.3.10, 5.02, 5.03, latest snapshot and 5.0 in combination with Apache 2.0.53 and 1.3.33 (I tried all combinations). 

While running under Windows 2000, 2003 and XP and trying to connect to a MSSQL server (on my local machine or a different server) using adodb 4.61 (http://adodb.sourceforge.net) the apache server crashes reporting php5ts.dll to be the problem (a runtime error dialog box occurs that when clicked restarts apache). It crashes Apache entirely and apache stops loading pages until it is reset. There are no error messages in the apache logs and one has to look in event viewer to see what caused the problem.

This crash happens randomly, it normally takes 8-10 refreshes of a page for a crash to occur (sometimes as many as 20 refreshes). It doesn't matter what page it is as long as the page pulls information from a MSSQL database.

The same page pulling from the exact same database using MySQL does not produce any errors and just keeps running.

Reproduce code:
---------------
require_once('adodb/adodb.inc.php');  

global $conn;
$conn =& ADONewConnection('odbc_mssql');    
$conn->SetFetchMode(ADODB_FETCH_BOTH);
$dsn="driver={sql server}; server=localhost; database=arb_db;";
$conn->pconnect($dsn, 'sa', 'ididit');
// Putting pconnect or connect makes no difference"

$sql = "SELECT Desc FROM Tours ORDER BY TourRank";
$rs = $conn->Execute($sql);

Expected result:
----------------
I expect it to pull Desc field from the Tours Table in the arb_db database.

Actual result:
--------------
Apache crashes in the way described. Apache crashes with a runtime error dialog and an error is logged under event viewer. 

This occurs on Windows 2003/2000/XP on with PHP 4.3.10, 5.02, 5.03, latest snapshot and 5.0 in combination with Apache 2.0.53 and 1.3.33 (I tried all combinations).

MSSQL 2000 and 97 were tried and MySQL 4.1 and 4.0. MySQL worked fine, MSSQL connection crashsed server. 

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-03-10 06:52 UTC] fmk@php.net
It looks like you are using ODBC and not MSSQL functions. Can you reproduce the same error with native PHP calls (eliminating the ADODB class)? This would be by using odbc_* or mssql_* functions.

Note the MSSQL library used for the MSSQL extension is not thread safe and might be causing this probem if you are using mssql_* functions. There is a new version of the mssql extension available. This is build using FreeTDS. You could try this version (mssql_* functions are 100% compatible). The dll is called php_dblib.dll, and it replaces php_mssql.dll.
 [2005-03-10 12:38 UTC] piotr at clickthinking dot com
Hi

Could you possibly provide more info on how to set this up as searching Google brings back very little information. I will try using just the mssql_ and odbc_ commands and see what it comes back with but adodb is just a wrapper.

But the FreeTDS extension sounds very promising so instructions on how to get this up and running would be very appreciated.
 [2005-03-25 02:06 UTC] sniper@php.net
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


 [2005-04-02 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 16:01:28 2024 UTC