M
M
Messi2018-07-27 10:03:27
PHP
Messi, 2018-07-27 10:03:27

How to install mssql driver for php?

Hello! Got Centos 7, php7.1, yii2 and ms sql remote database.
In the yii2 config, I specified driverName = mssql and added the required data. When I login to the site, I get an error:

could not find driver
Caused by: PDOException

Can you please tell me how to install ms sql driver in centos 7 for php 7.1?
PS Google search did not help.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Micro Null, 2018-07-27
@FitTech

I use freetds.
In /etc/freetds/freetds.conf I write the config, something like:

[test]
    host = ТУТ IP
    port = 1433
    tds version = 8.0
    client charset = utf-8

In PHP config:
['dsn' => 'dblib:host=test;dbname=Service_db;charset=UTF-8'],

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question