问题描述
我正在尝试使用Microsoft提供的文档为SQL Server安装PHP的Microsoft驱动程序.链接为> https://github.com/Microsoft/msphpsql
I am trying to install Microsoft Drivers for PHP for SQL Server using the document provided by Microsoft. Link is https://github.com/Microsoft/msphpsql
它提供了Ubuntu和Redhat的安装步骤,但没有提供Amazon Linux的安装步骤.要在Amazon上安装Microsoft驱动程序,我遵循了Redhat提供的步骤(不确定是否正确).当我运行命令
It provides installation steps for Ubuntu and Redhat but not Amazon Linux. To install Microsoft Drivers on Amazon, I followed steps provided for Redhat ( not sure if it is correct). When I run the command
sudo ACCEPT_EULA=Y yum install msodbcsql mssql-tools
遇到以下错误
Error: Package: msodbcsql-13.1.7.0-1.x86_64 (packages-microsoft-com-prod)
Requires: unixODBC >= 2.3.1
Available: unixODBC-2.2.14-14.7.amzn1.i686 (amzn-main)
unixODBC = 2.2.14-14.7.amzn1
该错误清楚地表明,要安装msodbcsql,unixODBC版本应为> = 2.3.1.但是可用于亚马逊的更新/最新的unixODBC软件包是unixODBC-2.2.14.
The error clearly says that to install msodbcsql, unixODBC version should be >= 2.3.1. But the updated/latest unixODBC package available for amazon is unixODBC-2.2.14.
我需要一些帮助,以便在Amazon Linux上安装适用于PHP的Microsoft驱动程序,以便可以使用 Sqlsrv PHP函数来连接SQL Server.
I need some help to install Microsoft Drivers for PHP on Amazon Linux so that I can use Sqlsrv PHP functions to connect SQL server.
PHP7,Apache和SQL服务器已经设置.
PHP7, Apache, and SQL server are already set up.
推荐答案
在谷歌搜索并尝试了所有方法之后,我找到了自己问题的答案.
After googling and trying all the ways, I found the answer to my own question.
代替使用
sudo ACCEPT_EULA=Y yum install msodbcsql mssql-tools
我用过
sudo ACCEPT_EULA=Y yum install msodbcsql-13.0.1.0-1 mssql-tools-14.0.2.0-1
问题已解决.
这篇关于如何在Amazon Linux AMI上为SQL Server安装PHP的Microsoft驱动程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!