關於 php 配置有關問題

來源:互聯網
上載者:User
關於 php 配置問題
環境: win7 iis7.5 php5.3.10 mssql 2008


要用php 串連sql下的微軟的sqlsrv。 裝好可以hello world


使用測試微軟的測試案例:
PHP code
 $value)      {              echo $key.": ".$value."\n";      }}else{       echo "Client info error.\n";}/* Close connection resources. */sqlsrv_close( $conn);?>


結果出現這個:

Could not connect. 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. ) )

這他娘是怎麼一會事。我搞了兩天了。要瘋掉了。 誰能救命

------解決方案--------------------
$serverName = "'local'";
$conn = sqlsrv_connect( $serverName);
????

串連資料庫連使用者名稱都不要嗎?什麼時候這樣大方了?
local 表示當前服務i中唯一的執行個體,家那麼多引號幹什麼
------解決方案--------------------

如需要閱讀該回複,請登入或註冊CSDN!


------解決方案--------------------

如需要閱讀該回複,請登入或註冊CSDN!


------解決方案--------------------

如需要閱讀該回複,請登入或註冊CSDN!

  • 聯繫我們

    該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

    如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.