美文网首页
php 7的mssql扩展安装说明

php 7的mssql扩展安装说明

作者: 小晨主 | 来源:发表于2019-04-28 14:42 被阅读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
    ACCEPT_EULA=Y yum install -y msodbcsql mssql-tools unixODBC-devel 
    cd /usr/local/src
    rm -rf sqlsrv* pdo*
    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
    echo ""
    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
    echo ""
    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
    ACCEPT_EULA=Y yum install -y msodbcsql mssql-tools unixODBC-devel 
    cd /usr/local/src
    rm -rf sqlsrv* pdo*
    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
    echo ""
    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
    echo ""
    grep "pdo_sqlsrv.so" /usr/local/php/php.ini || echo "extension=pdo_sqlsrv.so" >> /usr/local/php/php.ini
    rm -rf sqlsrv* pdo*
    

    相关文章

      网友评论

          本文标题:php 7的mssql扩展安装说明

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