Sql server 消息:此扩展需要用于SQL Server的Microsoft ODBC驱动程序11或13

Sql server 消息:此扩展需要用于SQL Server的Microsoft ODBC驱动程序11或13,sql-server,ubuntu,Sql Server,Ubuntu,在最近更新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

在最近更新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 );*
尝试了一次干净的安装,并使用PHP7.2获得了相同的结果,但这里的Linux技能设置很低。

来自

事实证明,php_sqlsrv 4.3.*(当前稳定)安装将尝试将msodbcsql更新为17。问题是php_sqlsrv需要5+才能与msodbcsql 17配合使用,但它的发布并不稳定

跑步:


这解决了该问题,再次更新将再次中断该问题。

您是否已在错误消息中安装了新的驱动程序?如果不值得先安装它,看看是否仍然会出现相同的错误???当我安装ODBC驱动程序时,它会说“已经是最新版本了”。
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