1 加入微软的源 curl https://packages.microsoft.com/config/rhel/7/prod.repo > /etc/yum.repos.d/mssqlrelease.repo 2 安装驱动 yum install msodbcsql mssql-tools unixODBC-devel 3 下周pdo_sqlser扩展包 http://pecl.php.net/package/pdo_sqlsrv tar -zxvf pdo_sqlsrv-4.0.8.tgz cd pdo_sqlsrv-4.0.8 /usr/local/php/bin/phpize ./configure --with-php-config=/usr/local/php/bin/php-config make make install 把生成的扩展加入到php.ini 重启php
参考网址 https://www.cnblogs.com/ytjjyy/p/8119708.html