php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #38849 ntwdblib.dll that comes with PHP5 does not work
Submitted: 2006-09-15 19:16 UTC Modified: 2006-09-23 11:33 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: dan dot mashal at gmail dot com Assigned:
Status: Not a bug Package: MSSQL related
PHP Version: 5.1.6 OS: Windows
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.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: dan dot mashal at gmail dot com
New email:
PHP Version: OS:

 

 [2006-09-15 19:16 UTC] dan dot mashal at gmail dot com
Description:
------------
The ntwdblib.dll that comes with PHP5 is corrupted. You must copy ntwdblib.dll from MSSQL 2000 to the C:\windows\system32 folder or C:\PHP folder. Otherwise MSSQL functionality is broken in PHP.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-09-15 23:06 UTC] tony2001@php.net
What do you mean by "corrupted", "does not work" and "broken" ?
 [2006-09-18 17:29 UTC] dan dot mashal at gmail dot com
I mean that you have to copy the ntwdblib.dll that is on the MSSQL2000 CD. Otherwise it doesnt work.
 [2006-09-18 17:30 UTC] dan dot mashal at gmail dot com
And by "does not work" I mean PHP is unable to connect to MSSQL databases.
 [2006-09-18 17:56 UTC] tony2001@php.net
Do you get any error messages?
 [2006-09-18 17:57 UTC] fmk@php.net
Copying the ntwdblib.dll is never a good option. Use the install process on the MSSQL Server to install the Client Tools. That will install the correct version of ntwdblib.dll and other tools that makes it possible to use all features and gives acces to the configuration tools.

Installing Client Tools will not install the server.
 [2006-09-18 18:25 UTC] dan dot mashal at gmail dot com
This does not solve the problem. You cannot install MSSQL 2000 Client tools on Windows 2003 web edition.
 [2006-09-18 18:29 UTC] dan dot mashal at gmail dot com
To Tony:

You just get a generic mssql_connect failed error. 

This is a known bug. 

From http://www.php.net/mssql_connect

"damartman (tradestudios.com)
23-Aug-2006 12:29 
I am running MS SQL Server 2005 Workgroup Edition on Windows 2003 with PHP 5.  I could not connect to a MS SQL database using mssql_pconnect(); until I read a post from ashraf (aat) ametry.com on 01-May-2006 01:25.  However, my fix was simply to:

1. Replace the ntwdblib.dll with the one from http://webzila.com/dll/1/ntwdblib.zip in my c:\php5 folder.

2. Restart IIS

REASON: The ntwdblib.dll should be version 2000.80.194.0, and not version 2000.2.8.0 that PHP 5 ships with.

Thank you ashraf for posting your note, however, changing the php.ini file value mssql.secure_connection = On did not work.  I left it mssql.secure_connection = Off and that worked (the default to connect through NT/Windows Authentication) "

This zip is basically the same ntwdblib.dll that ships with the MSSQL2000 CD.
 [2006-09-18 18:30 UTC] fmk@php.net
This sounds odd to me. the SQL Server Client tools is only a conectivity pack and it installs fine on the full version of Windows Server 2003 (I'm using that combination).

What kind of errors do you get when you try to install?
 [2006-09-18 18:46 UTC] dan dot mashal at gmail dot com
You are using standard edition. Try web edition. :)
 [2006-09-18 18:52 UTC] fmk@php.net
I do not have access to the web edition, so I asked what kind of errors you are getting when you try to install the client tools?

One of the features of the client tools is the ability to set the default protocol used to communicate with SQL server. If the dll is copied you rely on the default setting in the dll you are using and that changes from version to version. The default used to be netbios but was changed to tcp/ip at some point.
 [2006-09-18 22:24 UTC] dan dot mashal at gmail dot com
http://64.78.33.121/weberror.jpg
 [2006-09-19 15:06 UTC] edink@php.net
Installing Client Tools will solve the problem, not a bug in PHP itself.
 [2006-09-19 22:28 UTC] dan dot mashal at gmail dot com
Like I said you cannot install client tools on Windows Server 2003 web edition.
 [2006-09-20 09:18 UTC] edink@php.net
That is in no way a PHP bug.
 [2006-09-20 13:47 UTC] dan dot mashal at gmail dot com
So let me make sure I have this correct. According to edink if I am running W2k3 web edition, install PHP5 and then MSSQL connectivity does not work due to a broken file shipped with PHP it's not a bug and I'm supposed to just sit here twiddling my thumbs? Please give a solution instead of saying "it's not a bug".
 [2006-09-23 11:33 UTC] tony2001@php.net
Please complain to Microsoft and ask them why it's impossible to install the required libraries @ win2003.
Not PHP problem.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Feb 23 16:01:28 2024 UTC