1、安裝Microsoft ODBC Driver for SQL Server
首先安裝centos的odbc yum源
curl https://packages.microsoft.com/config/centos/7/prod.repo > /etc/yum.repos.d/ms-pred.repo
然后直接使用yum安裝
yum install -y msodbcsql17 unixODBC unixODBC-devel
2、安裝php擴(kuò)展
首先去微軟的github尋找編譯好的so文件
https://github.com/Microsoft/msphpsql/releases
這里需要注意的是 5.7移除了php7.1的支持? 5.7移除了對(duì)php7.2的支持
因此如果php版本是7.1的話? 只能下載 5.6 for PHP Driver for SQL Server
如果php版本是7.2的話 只能下載 5.8 for PHP Driver for SQL Server