2

SQL Server 2008 データベースへの接続で問題に直面しています。すでに PHP 拡張機能php_sqlsrv.dllをインストールしています。ネイティブ クライアント 10.0 もインストールしています。使用しているコードは次のとおりです。

 <?php /* Specify the server and connection string attributes. */
 $serverName = "(xxx.xx.x.xx)";

 /* Get UID and PWD from application-specific files.  */ $uid = "xxxxxx";
 $pwd = "xxxxx"; $connectionInfo = array( "UID"=>$uid,
                          "PWD"=>$pwd,
                          "Database"=>"xxxxxx");

 /* Connect using SQL Server Authentication. */ $conn = sqlsrv_connect(
 $serverName, $connectionInfo); if( $conn == false ) {
      echo "Unable to connect.</br>";
      die( print_r( sqlsrv_errors(), true)); } else {   echo "success";     }                                                                           sqlsrv_close($conn); ?>

また、SQL サーバーには認証タイプがあります。SQL SERVER AUTHENTICATIONです。上記のコードでは、次のエラーが発生しています。

Array ( 
        [0] => Array ( 
            [0] => 08001 
            [SQLSTATE] => 08001 
            [1] => 53 
            [code] => 53 
            [2] => [Microsoft][SQL Server Native Client 10.0]Named Pipes Provider: Could not open a connection to SQL Server [53]. 
            [message] => [Microsoft][SQL Server Native Client 10.0]Named Pipes Provider: Could not open a connection to SQL Server [53]. 
        ) 
        [1] => Array ( 
            [0] => HYT00 [SQLSTATE] => HYT00 
            [1] => 0 [code] => 0 
            [2] => [Microsoft][SQL Server Native Client 10.0]Login timeout expired 
            [message] => [Microsoft][SQL Server Native Client 10.0]Login timeout expired 
        ) 
        [2] => Array ( 
            [0] => 08001 [SQLSTATE] => 08001 
            [1] => 53 [code] => 53 
            [2] => [Microsoft][SQL Server Native Client 10.0]A network-related or instance-specific error has occurred while establishing a connection to SQL Server. Server is not found or not accessible. Check if instance name is correct and if SQL Server is configured to allow remote connections. For more information see SQL Server Books Online. 
            [message] => [Microsoft][SQL Server Native Client 10.0]A network-related or instance-specific error has occurred while establishing a connection to SQL Server. Server is not found or not accessible. Check if instance name is correct and if SQL Server is configured to allow remote connections. For more information see SQL Server Books Online. 
        ) 
    )

助けてください

4

0 に答える 0