Ali uporabljate PHP5, Apache(WAMP paket) in se povezujete na zunanji SQL SERVER 2005 strežnik in kljub pravilnim podatkom dobite napako:
Warning: mssql_connect() [function.mssql-connect]: message: Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON'. (severity 14) in ...
Zakaj?
Basically this question has nothing to do with SQL Server, but with PHP. There it is well documented on PHP.net documentation. Quote:
When using Windows integrated security then the window user account is used (the account where actually PHP is executed in) and the username and password are ignored. So you can either run Apache under an appropriate account or use SQL Server authentication (so called mixed authentiaction).
Odprava napake
V php.ini spremenite nastavitev mssql.secure_connection na:
-
mssql.secure_connection = Off
V primeru, da uporabljamo Windows authentication mode, v php.ini nastavimo mssql.secure_connection = On, v primeru da uporabljamo Mixed auth mode nastavimo na Off. The user is not associated with a trusted SQL Server connection je napaka, ki se pojavi, če uporabljate Windows authentication mode in mssql.secure_connection = Off.
Podobni članki: