I have WAMP and am trying to connect to to my SQL Server 2008 database by entering a domain user and password using the following PHP command:
$serverName = "MySQLServer\Instance"; //serverName\instanceName
$connectionInfo = array( "Database"=>"dbName",
"UID"=>"myADUserName", "PWD"=>"MyPassword");
$conn = sqlsrv_connect( $serverName, $connectionInfo);
As I understand it, it is trying to authenticate with a SQL Server created user and not from the Active Directory, so I am getting the following error message:
Array ( [0] =>
Array ( [0] => 28000 [SQLSTATE] => 28000
[1] => 18456 [code] => 18456
[2] => [Microsoft][SQL Server Native Client 10.0]
[SQL Server]Login failed for user 'myADUserName'.
[message] => [Microsoft]
[SQL Server Native Client 10.0]
[SQL Server]Login failed for user 'myADUserName'.
)
[1] =>
Array ( [0] => 28000 [SQLSTATE] => 28000
[1] => 18456 [code] => 18456
[2] => [Microsoft][SQL Server Native Client 10.0]
[SQL Server]Login failed for user 'myADUserName'.
[message] => [Microsoft]
[SQL Server Native Client 10.0]
[SQL Server]Login failed for user 'myADUserName'.
)
)
Is this possible in PHP with WAMP?
I've read about changing the log on account in the wampapache service to myADUserName, but the user doesn't have access administrator access on the server to allow this and I wouldn't want to tie one account to all my PHP applications.