fcaserio Posted January 21, 2009 Share Posted January 21, 2009 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: 10.17.4.4 in C:\htdocs\teste.php on line 16 On the same PHP server I can connect to the MSSQL server 10.17.4.4 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 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 Quote Link to comment https://forums.phpfreaks.com/topic/141761-problems-on-mssql-conection/ Share on other sites More sharing options...
fcaserio Posted January 21, 2009 Author Share Posted January 21, 2009 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: 10.17.4.4 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? Quote Link to comment https://forums.phpfreaks.com/topic/141761-problems-on-mssql-conection/#findComment-742112 Share on other sites More sharing options...
corbin Posted January 21, 2009 Share Posted January 21, 2009 Looks like you're not passing mssql_connect a username/password. I don't know if mssql_connect can use Windows auth. Quote Link to comment https://forums.phpfreaks.com/topic/141761-problems-on-mssql-conection/#findComment-742679 Share on other sites More sharing options...
phewett Posted March 14, 2009 Share Posted March 14, 2009 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 Quote Link to comment https://forums.phpfreaks.com/topic/141761-problems-on-mssql-conection/#findComment-784886 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.