$this->_connection = new PDO("odbc:Driver={SQL Server};Server=$serverName,1433; Database=".DB_NAME.";",DB_USER,DB_PASS);
This is my connection to database. I have installed php71-php-odbc.x86_64 0:7.1.9-1.el7.remi
using the command yum --enablerepo=remi install php71-php-odbc
it confirmed installation by
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : php71-runtime-1.0-1.el7.remi.x86_64 1/5
Installing : php71-php-common-7.1.9-1.el7.remi.x86_64 2/5
Installing : php71-php-json-7.1.9-1.el7.remi.x86_64 3/5
Installing : php71-php-pdo-7.1.9-1.el7.remi.x86_64 4/5
Installing : php71-php-odbc-7.1.9-1.el7.remi.x86_64 5/5
Verifying : php71-php-json-7.1.9-1.el7.remi.x86_64 1/5
Verifying : php71-php-odbc-7.1.9-1.el7.remi.x86_64 2/5
Verifying : php71-php-common-7.1.9-1.el7.remi.x86_64 3/5
Verifying : php71-php-pdo-7.1.9-1.el7.remi.x86_64 4/5
Verifying : php71-runtime-1.0-1.el7.remi.x86_64 5/5
Installed:
php71-php-odbc.x86_64 0:7.1.9-1.el7.remi
Dependency Installed:
php71-php-common.x86_64 0:7.1.9-1.el7.remi
php71-php-json.x86_64 0:7.1.9-1.el7.remi
php71-php-pdo.x86_64 0:7.1.9-1.el7.remi
php71-runtime.x86_64 0:1.0-1.el7.remi
In the command line. The thing im confused is the output of print_r(PDO::getAvailableDrivers());
is
Array
(
[0] => mysql
[1] => sqlite
)
I am expecting that odbc will be added in the result. Also if i run php -m
in the command there is no odbc in module list in command.
What is the correct way to install the driver need for the connection stated above.
Server runs centOS 7
Update
Installing odbc driver to get rid of error saying Caught exception: could not find driver