First, to join the source of Microsoft
Curl Https://packages.microsoft.com/config/rhel/7/prod.repo >/etc/yum.repos.d/mssqlrelease.repo
Second, prevent conflicts first uninstall the original version (optional)
Yum Remove UnixODBC
Three, the installation of the driver (three must be installed, indispensable)
Yum Install Msodbcsql Mssql-tools unixodbc-devel
Iv. Download pdo_sqlsrv expansion pack http://pecl.php.net/package/pdo_sqlsrv
V. Taking 4.0.8 as an example
TAR-ZXVF pdo_sqlsrv-4.0.8.tgz
Six, enter the decompression directory
CD pdo_sqlsrv-4.0.8
Vii. an extended command to execute PHP
/usr/local/php/bin/phpize
Eight, compile
./configure--with-php-config=/usr/local/php/bin/php-config
Nine, installation
Make && make install
X. Modify/usr/local/php/etc/php.ini Find: extension = Add extension = "pdo_sqlsrv.so" after the last extension=
Over
PHP7. x connecting SQL Server database (CENTOS7)