2013-08-20 77 views
0

我在使用sqlsrv_connect在PHP中使用Windows 2003服務器上的sqlsrv連接mssql server 2008時出現以下錯誤。 Microsoft SQL Server 2008 Native Client已安裝。在IIS 6.0 Web服務器運行在Windows 2003服務器上連接到mssql server 2008時出現sqlsrv錯誤

這裏的php.ini文件內容

=======================

[PHP_SQLSRV] 
extension=php_sqlsrv_53_ts_vc9.dll 
[PHP_PDO_SQLSRV] 
extension=php_pdo_sqlsrv_53_nts_vc6.dll 
php_pdo_sqlite.dll 

== =====================

Array 
(
    [0] => Array 
     (
      [0] => IMSSP 
      [SQLSTATE] => IMSSP 
      [1] => -49 
      [code] => -49 
      [2] => This extension requires the Microsoft SQL Server 2012 Native Client. Access the following URL to download the Microsoft SQL Server 2012 Native Client ODBC driver for x86: http://go.microsoft.com/fwlink/?LinkId=163712 
      [message] => This extension requires the Microsoft SQL Server 2012 Native Client. Access the following URL to download the Microsoft SQL Server 2012 Native Client ODBC driver for x86: http://go.microsoft.com/fwlink/?LinkId=163712 
     ) 

    [1] => Array 
     (
      [0] => IM002 
      [SQLSTATE] => IM002 
      [1] => 0 
      [code] => 0 
      [2] => [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified 
      [message] => [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified 
     ) 

) 

回答

0

兩種方式去嘗試,

首先檢查本地驅動程序有正確的版本 -
是你的服務器真的是一個32位版本,而不是84位?

另一件事是,檢查擴展是否實際加載。

若要檢查,請創建一個文件,如「phpinfo.php」,並將其放入.htdocs文件夾中。

<?php 

// show phpinfo file 
phpinfo(); 

?> 

最簡單的辦法是尋找它在的phpinfo頁使用Ctrl + F和 「延長= php_sqlsrv_53_ts_vc9.dll」

0
  1. 去這個網站:Microsoft download site
  2. 滾動到(+) Install Instructions部分,然後單擊它。
  3. 本節內容將滾動至:Microsoft® SQL Server® 2012 Native Client
  4. 你會看到有兩個環節:安裝其中一個(最多到系統32或64)

X86包(sqlncli.msi)X86 direct link

X64包(sqlncli.msi)其評論中的直接鏈接

+1

[X64程序包直接鏈接](http://go.microsoft.com/fwlink/?LinkID=239648&clcid=0x409) – Ayman

相關問題