I cannot figure out the way to connect MSSQL 2014 database on centos 8 using PhP 7.4. I found GitHub link and downloaded CentOS8-7.4.tar and extracted the php_sqlsrv_72_ts.so and php_pdo_sqlsrv_72_ts.so. but not sure where to paste the modules like
windows => xampp folder > php >> extensions
edit php.ini; extension=php_sqlsrv_72_ts and restart web server
Any help or guidance is really appreciated. Here are the commands I did run:
dnf -y update
dnf install yum-utils http://rpms.remirepo.net/enterprise/remi-release-8.rpm -y
dnf module reset php
dnf module enable php:remi-7.4
yum module reset nginx
yum module enable nginx:1.16
dnf install wget nginx php-fpm mariadb-server php-mysqli php-gd php-imap php-xml php-mbstring php-intl php-pecl-apcu php-opcache php-pecl-zip
systemctl enable --now nginx php-fpm mariadb
firewall-cmd --permanent --zone=public --add-service=http --add-service=https
firewall-cmd --reload
PHP:
<?php
$serverName = "ServerIP\Instance";
$connectionInfo = array( "Database"=>"dummydatabase", "UID"=>"sa", "PWD"=>"mystrongpasswrod",'ReturnDatesAsStrings'=> true);
$conn = sqlsrv_connect( $serverName, $connectionInfo );
if( $conn === false ) {
die( print_r( sqlsrv_errors(), true));
}
else{
echo 'Successfully Connected';
}