|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #44869 MSSQL Connect => Access Violation
Submitted: 2008-04-30 12:52 UTC Modified: 2010-05-27 10:02 UTC
Avg. Score:4.8 ± 0.4
Reproduced:4 of 4 (100.0%)
Same Version:2 (50.0%)
Same OS:3 (75.0%)
From: vds dot jeroen at gmail dot com Assigned: pajoye (profile)
Status: Closed Package: MSSQL related
PHP Version: 5.2.6 OS: Windows XP SP2
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: vds dot jeroen at gmail dot com
New email:
PHP Version: OS:


 [2008-04-30 12:52 UTC] vds dot jeroen at gmail dot com
When trying to connect to a local MSSQL 2005 Express server using mssql_connect() in combination with IIS 5.1 on Windows XP SP2, I get this error:

PHP has encountered an Access Violation at 7333F15A

When I run the script some more, I get this error.
PHP has encountered an Access Violation at 7333F179

When I run the script some more, I don't have a problem.

When I connect to another MSSQL server than my local one, I don't have a problem at all.

I tried it with PHP 5.2.5 and 5.2.6RC5

I'm not the only one with this problem:

When I use Apache 2.2.2, Apache crashes with PHP 5.2.5 when trying to connect.

BTW: I'm using the newer ntwdblib.dll (2000.80.194.0)

Reproduce code:
$username = "sa";
$password = "*********";
$database = "plrapport";

$conn = mssql_connect("LAPTOPHP\SQLEXPRESS","$username","$password");

Expected result:
Nothing should happen, but the connection should be made. I check if the connection is made by running a query.

Actual result:
When I just try to connect, with or without issueing a query, I get 
PHP has encountered an Access Violation at 7333F15A

I tried to make a backtrace, but I ended up with a very long mht file.
Download it here:


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2008-05-07 17:16 UTC] vds dot jeroen at gmail dot com
I still have the same problem with 5.2.6 final
 [2008-05-21 11:17 UTC] vds dot jeroen at gmail dot com
It's working when I use FreeTDS.
 [2008-08-19 07:35 UTC] svfly2 at yandex dot ru
Have same problem on WinXP apache 2.2.9 php 5.2.5

works with ntwdblib 2000.2.8.0
crash with ntwdblib 2000.80.194.0

works with win2003 server with  ntwdblib 2000.80.194.0
 [2008-11-11 14:42 UTC]
Thank you for this bug report. To properly diagnose the problem, we
need a backtrace to see what is happening behind the scenes. To
find out how to generate a backtrace, please read for *NIX and for Win32

Once you have generated a backtrace, please submit it to this bug
report and change the status back to "Open". Thank you for helping
us make PHP better.

 [2010-05-27 07:43 UTC] fenik17 at gmail dot com
Patched ntwdblib.dll v.2000.80.194.0:
 [2010-05-27 10:02 UTC]
-Status: Open +Status: Closed -Assigned To: +Assigned To: pajoye
 [2010-05-27 10:02 UTC]
The lib has already been updated, using an official version.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Feb 27 05:01:32 2024 UTC