gpt4 book ai didi

sql-server - 消息 : This extension requires the Microsoft ODBC Driver 11 or 13 for SQL Server

转载 作者:行者123 更新时间:2023-12-04 18:45:11 25 4
gpt4 key购买 nike

在最近更新到 Ubuntu 后使用 PHP 7.1 运行 Ubuntu 16 6 个月,在连接到 MS-SQL Server 时收到以下错误:

Error information: 
SQLSTATE: IMSSP
Code: -49
Message: This extension requires the Microsoft ODBC Driver 11 or 13 for SQL Server. Access the following URL to download the ODBC Driver 11 or 13 for SQL Server for x64: http://go.microsoft.com/fwlink/?LinkId=163712
SQLSTATE: IM002
Code: 0
Message: [unixODBC][Driver Manager]Data source name not found, and no default driver specified

示例代码:
*$serverName = "10.0.9.1";
$connectionOptions = array(
"Database" => "db",
"Uid" => "id",
"PWD" => "pass"
);
//Establishes the connection
$conn = sqlsrv_connect( $serverName, $connectionOptions );*

尝试了全新安装并使用 PHP 7.2 相同的结果,但这里的 Linux 技能设置较低。

最佳答案

来自 New Microsoft ODBC Driver 17 breaks LAMP server

结果 php_sqlsrv 4.3.* (current stable) install 将尝试将 msodbcsql 更新到 17。问题是 php_sqlsrv 需要 5+ 才能与 msodbcsql 17 一起使用,但它没有发布为稳定版本。

冉:

sudo su 
curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add -
curl https://packages.microsoft.com/config/ubuntu/16.04/prod.list > /etc/apt/sources.list.d/mssql-release.list
exit
sudo ACCEPT_EULA=Y apt-get install msodbcsql=13.1.9.0-1 mssql-tools=14.0.6.0-1 unixodbc-dev

这解决了问题,再次更新将再次破坏它。

关于sql-server - 消息 : This extension requires the Microsoft ODBC Driver 11 or 13 for SQL Server,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48817027/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com