美文网首页
Centos系统PHP7安装Sqlserver扩展

Centos系统PHP7安装Sqlserver扩展

作者: 文档随手记 | 来源:发表于2018-10-23 13:32 被阅读0次

CentOS 6

    curl https://packages.microsoft.com/config/rhel/6/prod.repo > /etc/yum.repos.d/mssql-release.repo

    yum clean all

    yum update -y

    yum install -y msodbcsql mssql-tools unixODBC-devel

    cd /usr/local/src

    wget https://pecl.php.net/get/sqlsrv-4.3.0.tgz

    tar -zxvf sqlsrv-4.3.0.tgz

    cd sqlsrv-4.3.0

    phpize

    ./configure

    make

    make install

    grep "sqlsrv.so" /usr/local/php/php.ini || echo "extension=sqlsrv.so" >> /usr/local/php/php.ini

    cd /usr/local/src

    wget https://pecl.php.net/get/pdo_sqlsrv-4.3.0.tgz

    tar -zxvf pdo_sqlsrv-4.3.0.tgz

    cd pdo_sqlsrv-4.3.0

    phpize

    ./configure

    make

    make install

    grep "pdo_sqlsrv.so" /usr/local/php/php.ini || echo "extension=pdo_sqlsrv.so" >> /usr/local/php/php.ini

    rm -rf sqlsrv* pdo*

======================================================

CentOS 7

    curl https://packages.microsoft.com/config/rhel/7/prod.repo > /etc/yum.repos.d/mssql-release.repo

    yum clean all

    yum update -y

    yum install -y msodbcsql mssql-tools unixODBC-devel

    cd /usr/local/src

    wget https://pecl.php.net/get/sqlsrv-4.3.0.tgz

    tar -zxvf sqlsrv-4.3.0.tgz

    cd sqlsrv-4.3.0

    phpize

    ./configure

    make

    make install

    grep "sqlsrv.so" /usr/local/php/php.ini || echo "extension=sqlsrv.so" >> /usr/local/php/php.ini

    cd /usr/local/src

    wget https://pecl.php.net/get/pdo_sqlsrv-4.3.0.tgz

    tar -zxvf pdo_sqlsrv-4.3.0.tgz

    cd pdo_sqlsrv-4.3.0

    phpize

    ./configure

    make

    make install

    grep "pdo_sqlsrv.so" /usr/local/php/php.ini || echo "extension=pdo_sqlsrv.so" >> /usr/local/php/php.ini

    rm -rf sqlsrv* pdo*

相关文章

网友评论

      本文标题:Centos系统PHP7安装Sqlserver扩展

      本文链接:https://www.haomeiwen.com/subject/sktazftx.html