简体   繁体   English

PHP MsSQL WAMP-无法连接到MSSQL

[英]PHP MsSQL WAMP - Couldn't connect to MSSQL

I've downloaded SQLSRV32.EXE from the official MSSQL Driver for PHP and extracted php_sqlsrv_56_ts.dll & php_pdo_sqlsrv_56_ts.dll into C:\\wamp\\bin\\php\\php5.6.19\\ext 我已经从PHP的官方MSSQL驱动程序中下载 SQLSRV32.EXE,并将php_sqlsrv_56_ts.dll和php_pdo_sqlsrv_56_ts.dll提取到了C:\\wamp\\bin\\php\\php5.6.19\\ext

Added the following declaration in the php.ini from the WAMP menu. 在WAMP菜单的php.ini中添加了以下声明。

extension=php_pdo_sqlsrv_56_ts.dll
extension=php_sqlsrv_56_ts.dll

I then run the sample code from the reference page . 然后,我从参考页运行示例代码。

I couldn't connect to the MS SQL Server due to the following error 由于以下错误,我无法连接到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 ) )

I've tried to download the ODBC Driver 13 (for Windows 10) but it is not working. 我尝试下载ODBC驱动程序13(适用于Windows 10),但无法正常工作。 Can someone tell me what I'm doing wrong? 有人可以告诉我我在做什么错吗?

版本不兼容

As I can see - ODBC Driver 13 is not supported on your system and the required one is ODBC Driver 11. 如我所见-ODBC驱动程序13在您的系统上不受支持,所需的一个是ODBC Driver 11。

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM