In this tutorial we show how to install the drivers to connect to Microsoft SQL Server (Almalinux Server with aapanel and PHP)
Requirements:
AlmaLinux 8.8
PHP 7.4
aapanel control panel
Access your turbohost instance through the terminal and run the following commands as root:
curl https://packages.microsoft.com/config/rhel/7/prod.repo > /etc/yum.repos.d/mssql-release.repoyum clean allyum update -yACCEPT_EULA=Y yum install -y msodbcsql mssql-tools unixODBC-develcd /tmpwget https://pecl.php.net/get/sqlsrv-5.8.0.tgztar -zxvf sqlsrv-5.8.0.tgzcd sqlsrv-5.8.0/www/server/php/74/bin/phpize./configure --with-php-config=/www/server/php/74/bin/php-configmakemake installecho "extension=sqlsrv.so" >> /www/server/php/74/etc/php.inicd /tmpwget https://pecl.php.net/get/pdo_sqlsrv-5.8.0.tgztar -zxvf pdo_sqlsrv-5.8.0.tgzcd pdo_sqlsrv-5.8.0/www/server/php/74/bin/phpize./configure --with-php-config=/www/server/php/74/bin/php-configmakemake installecho ""echo "extension=pdo_sqlsrv.so" >> /www/server/php/74/etc/php.iniIf the following error occurs when connecting to the bank:[ODBC 17 Driver for SQL Server]SSL Provider: [error:1425F102:SSL Routines:ssl_choose_client_version:unsupported protocol] [message]
Must enable TLS minor version support for TLS1. Edit the file /etc/crypto-policies/back-ends/openssl/opensslcnf.config and add or change the following line with the MinProtocol:
TLS.MinProtocol = TLSv1.0