Cara install extension SQLSRV dan PDO_SQLSRV PHP 7.4 di aaPanel

Cara install extension sqlsrv dan pdo_sqlsrv PHP 7.4 di aaPanel di Linux CentOS

Install driver

yum install msodbcsql mssql-tools unixODBC-devel

Download sqlsrv

Cek versi terbaru di sini, saat tutor ini dibuat 5.10.1

cd /tmp/
wget https://pecl.php.net/get/sqlsrv-5.10.1.tgz

Ekstrak sqlsrv

tar xvf sqlsrv-5.10.1.tgz

Compile dan install sqlsrv

cd sqlsrv-5.10.1
/www/server/php/74/bin/phpize
./configure --with-php-config=/www/server/php/74/bin/php-config
make && make install

Download pdo_sqlsrv

Cek versi terbaru di halaman resmi saat tutorial ini dibuat versi 5.10.1

cd /tmp
wget http://pecl.php.net/get/pdo_sqlsrv-5.10.1.tgz

Ekstrak pdo_sqlsvr

tar xvf pdo_sqlsrv-5.10.1.tgz

Compile dan install pdo_sqlsvr

/www/server/php/74/bin/phpize
./configure --with-php-config=/www/server/php/74/bin/php-config
make && make install

Aktifkan extension sqlsrv dan pdo_sqlsrv

echo "extension=sqlsrv.so" >> /www/server/php/74/etc/php.ini
echo "extension=pdo_sqlsrv.so" >> /www/server/php/74/etc/php.ini

Restart PHP

Restart PHP melalui control panel aaPanel

Cleaning

Hapus bekas file instalasi

cd /tmp
rm -rf pdo_sqlsrv-5.10.1 pdo_sqlsrv-5.10.1.tgz sqlsrv-5.10.1 sqlsrv-5.10.1.tgz

Selesai, semoga bermanfaat.

Segera kontak idnetter.com melalui WA jika Anda kesulitan install PHP extension di aaPanel.

Add a comment