Problem connecting Yii2 with SQL Server

0

I'm trying to connect my Yii2 application with a database in SQL Server, the version I'm using is 10.0, this is my error message:

  

exception 'PDOException' with message 'SQLSTATE [08001]: [Microsoft] [ODBC Driver 11 for SQL Server] Named Pipes Provider: Could not open a connection to SQL Server [2].

Configuration file

return [
    'class' => 'yii\db\Connection',
    'dsn' => 'sqlsrv:Server=localhost;Database=softwareoperacional',
    'username' => 'sa',
    'password' => 'admin123',
    'charset' => 'utf8',
];
    
asked by Sebastian Salazar 01.03.2018 в 03:10
source

1 answer

0

Do you have Microsoft Drivers for PHP for SQL Server installed? I also had the same error installing the driver was solved.

    
answered by 03.03.2018 в 00:25