Windows 認証を使用して会社の MSSQL サーバーへの接続を確立しようとしていますが、ログイン ID の代わりにコンピューター名をログインとして使用しようとして失敗します。MS SQL Server Management でログインすると、Windows 認証は正常に機能しますが、次の PHP コードでは機能しません。
<?php
// Server in the this format: <computer>\<instance name> or
// <server>,<port> when using a non default port number
$serverName = "xxx";
$connectionInfo = array( "Database"=>"xxx");
/* Connect using Windows Authentication. */
$conn = sqlsrv_connect( $serverName, $connectionInfo);
if( $conn ) {
echo "Connection established.<br />";
}else{
echo "Connection could not be established.<br />";
die( print_r( sqlsrv_errors(), true));
}
//
?>
私が得る印刷物は次のとおりです。
[Microsoft][SQL Server Native Client 11.0][SQL Server]ユーザー 'xxx\T2002197$' のログインに失敗しました。) )
T2002197 は私のコンピューター名であり、ログイン ID ではないため、もちろん失敗します。どうすればこれを解決できますか? WAMPを使用しています。一部の情報を編集し、「xxx」に置き換えました