PHP7. x connecting SQL Server database (CENTOS7)

Source: Internet
Author: User

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)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.