Connecting to SQL Server using windows authentication
I read that if you don't specify a username or password, PHP will use windows authentication by default. But it will use the credentials of the identity of the app pool that is running the php application.
So I made an app pool, and set it to run under the identity of an active directory user (this user is used to connect to the same DB for other processes).
But when I run the form, I get a connection error. It looks like the PHP engine is trying to connect to the database as an anonymous user rather than with the application pool identity.
Has anyone out there set this up?
[SQLSTATE] => 28000  => 18456
Code: Select all
=> 18456  => [Microsoft][ODBC Driver 13 for SQL Server][SQL Server]Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON'. [message] => [Microsoft][ODBC Driver 13 for SQL Server][SQL Server]Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON'. )  => Array (  => 28000 $serverName = "trans"; $connectionInfo = array("Database"=>"transdb"); $conn = sqlsrv_connect($serverName,$connectionInfo);