關於 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!