Jump to content

Problems on MSSQL conection


Recommended Posts

I'm migrating an application PHP + SQL Server 2005 that is actually installed on servers (Linux + Win2003) to (Win2003 + Win2003). The database server is the same, only the PHP server is being replaced.

When I try to connect to MSSQL from the new Win2003 server I receive the following error message:


Warning: mssql_connect() [function.mssql-connect]: Unable to connect to server: in C:\htdocs\teste.php on line 16


On the same PHP server I can connect to the MSSQL server with the same credentials using SQL Server Management Studio.

Which means I can check that there is conectivity, but PHP doesnot connect.


I dont know if I'm missing some configuration detail. This are PHP configurations for MSSQL:



MSSQL Support enabled

Active Persistent Links 0

Active Links 0

Library version 7.0


Directive Local Value Master Value

mssql.allow_persistent On On

mssql.batchsize 0 0

mssql.compatability_mode Off Off

mssql.connect_timeout 5 5

mssql.datetimeconvert On On

mssql.max_links Unlimited Unlimited

mssql.max_persistent Unlimited Unlimited

mssql.max_procs Unlimited Unlimited

mssql.min_error_severity 10 10

mssql.min_message_severity 10 10

mssql.secure_connection On On

mssql.textlimit Server default Server default

mssql.textsize Server default Server default

mssql.timeout 60 60


tks for any help



Report this post

Link to comment
Share on other sites

After copying ntwdblib.dll to C:\Windows\System32 the connection start to work, but now I'm receiving the following error:


Warning: mssql_connect() [function.mssql-connect]: message: Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON'. (severity 14) in C:\htdocs\teste.php on line 17

Warning: mssql_connect() [function.mssql-connect]: Unable to connect to server: in C:\htdocs\teste.php on line 17


The strange thing is: If I execute the same script on prompt, it works:

c:\Progra~1\php\php.exe c:\htdocs\teste.php


Any ideas?

Link to comment
Share on other sites

  • 1 month later...

I had the same issue.

I was using SQL 2005 EXpress and the ntwdblin/dll I was using was too old.

Upgrading to alter one fixed the problem for me.

ALos syou shouldn't need ot put the dll in c:\windows or c:\windows\system32. I only have one and it's in c:\php.

The original version of the DDL (didn'towkr) that I was suing was 2000.2.8.0)

The one that works for me is version : 2000.80.194.0

I found the answer and a download link in a manual page comment on php.net, but I don't seem tobe able to find it now...

I imagine you'll be able to get a hold of the file by googling for it. I believe the new one is part of windows 2000 sP4.

This link will help http://dba.fyicenter.com/faq/sql_server_2/Finding_ntwdblib_dll_Version_2000_80_194_0.html



Link to comment
Share on other sites


This topic is now archived and is closed to further replies.

  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.