PHP MsSQL WAMP - 无法连接到MSSQL

时间:2016-06-03 01:51:46

标签: php sql-server

我从the official MSSQL Driver for PHP下载了SQLSRV32.EXE并解压缩了php_sqlsrv_56_ts.dll& php_pdo_sqlsrv_56_ts.dll到C:\wamp\bin\php\php5.6.19\ext

在WAMP菜单的php.ini中添加了以下声明。

extension=php_pdo_sqlsrv_56_ts.dll
extension=php_sqlsrv_56_ts.dll

然后我从reference page运行示例代码。

由于以下错误,我无法连接到MS SQL Server

Connection could not be establish
Array ( [0] => Array ( [0] => IMSSP [SQLSTATE] => IMSSP [1] => -49 [code] => -49 [2] => This extension requires the Microsoft ODBC Driver 11 for SQL Server. Access the following URL to download the ODBC Driver 11 for SQL Server for x86: http://go.microsoft.com/fwlink/?LinkId=163712 [message] => This extension requires the Microsoft ODBC Driver 11 for SQL Server. Access the following URL to download the ODBC Driver 11 for SQL Server 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 ) )

我尝试下载ODBC驱动程序13(适用于Windows 10),但它无法正常工作。有人能告诉我我做错了吗?

Version incompatible

1 个答案:

答案 0 :(得分:0)

正如我所看到的 - 您的系统不支持ODBC驱动程序13,所需的是ODBC驱动程序11.

https://www.microsoft.com/en-us/download/details.aspx?id=36434