• Discussion
  • How to install mssql on php7 with apache2

Hi i'm already try installation tutorial any site but still not work on aapanel, i wanna ues php-mssql and sqlserv for connect php to sql server microsoft.

thanks

    13 days later

    adepratama

    You can try the following tutorial,
    Here take php73 as an example

    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 /tmp
    wget https://pecl.php.net/get/sqlsrv-4.3.0.tgz
    tar -zxvf sqlsrv-4.3.0.tgz
    cd sqlsrv-4.3.0
    /www/server/php/73/bin/phpize
    ./configure
    make
    make install
    
    echo "extension=sqlsrv.so" >> /www/server/php/73/etc/php.ini
    cd /tmp
    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
    /www/server/php/73/bin/phpize
    ./configure
    make
    make install
    echo ""
    echo "extension=pdo_sqlsrv.so" >> /www/server/php/73/etc/php.ini
      a year later

      aaPanel_Jose Hi, only forget this

      ./configure --with-php-config=/www/server/php/73/bin/php-config

      I install in PHP7.3 and PHP7.4

      Regards from Costa Rica 😀

        6 months later
        7 months later
        17 days later