【问题标题】:PHP MsSQL WAMP - Couldn't connect to MSSQLPHP MsSQL WAMP - 无法连接到 MSSQL
【发布时间】:2016-06-03 01:51:45
【问题描述】:

我已经从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),但无法正常工作。谁能告诉我我做错了什么?

【问题讨论】:

  • 您是否为您的特定操作系统下载了正确的文件?

标签: php sql-server


【解决方案1】:

如我所见 - 您的系统不支持 ODBC 驱动程序 13,需要的是 ODBC 驱动程序 11。

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-06-02
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多