Hello!
After a long wait at the end, I have to develop a system using Yii2
and SQL Server
.
I downloaded XAMPP with PHP 5.6.31 and I installed SQL Server 2008 and I can not connect to the database.
I have already tried downloading the official versions of SQL Server drivers for Microsoft PHP using this link:
Microsoft Drivers for PHP for SQL Server
I have also activated the extensions in the file php.ini
extension=php_pdo_sqlsrv_56_nts.dll
extension=php_pdo_sqlsrv_56_ts.dll
extension=php_sqlsrv_56_ts.dll
extension=php_sqlsrv_56_nts.dll
My configuration file to the database is as follows:
return [
'class' => 'yii\db\Connection',
'dsn' => 'sqlsrv:Server=127.0.0.1;Database=softwareoperacional',
'username' => 'sa',
'password' => 'admin123',
'charset' => 'utf8',
];
As an error message I get the following:
exception 'PDOException' with message 'SQLSTATE [08001]: [Microsoft] [ODBC Driver 11 for SQL Server] Named Pipes Provider: Could not open a connection to SQL Server
Check the PHPInfo and show the following in the PDO Drivers
I connect to my database manager as follows
Does anyone here would be kind enough to tell me what I'm doing wrong in the configuration or what version should I install?
Beforehand, thank you for your attention, if there is something that I need, I gladly review it, I remain pending.
Greetings,