Page 1 of 1

Problems on MSSQL conection

Posted: Wed Jan 21, 2009 6:28 am
by fcaserio
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

Re: Problems on MSSQL conection

Posted: Wed Jan 21, 2009 7:28 am
by fcaserio
After copying ntwdblib.dll to C:\Windows\System32 the connection start to work, but now I'm receiving the following error:

Code: Select all

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?

Re: Problems on MSSQL conection

Posted: Wed Jan 21, 2009 7:33 am
by fcaserio
I was using secure_conection = On.
I just disable it and is worked.