Yii 2.0 Connect to SQLServer 2008 R2

Hi all,

I’m struggling to find a working configuration to connect Yii 2.0 SQLServer 2008 R2.

Windows 7 Ultimate

XAMPP 3.2.1

PHP 5.5.6

Works fine without Yii.

( added: extension=php_sqlsrv_55_ts.dll and extension=php_pdo_sqlsrv_55_ts.dll to php.ini)

Yii 2.0 Basic Install works.

Now i want to edit \basic\config\db.php to configure the connention and use Gii Model generation.

Anyone knows how to ??

What i tried till now:

return [

'class' => 'yii\db\Connection',


'dsn' => 'sqlsrv:Server=abc/inst;database=mydb',	


'username' => 'xx',


'password' => 'secret',   	

];

/basic/web/index.php?r=gii Model Generator returns:

SQLSTATE[08001]: [Microsoft][SQL Server Native Client 11.0]Named Pipes Provider:

Could not open a connection to SQL Server [67].

obviously wrong class

so i tried

return [

'class' => 'yii\db\mssql\SqlsrvPDO',


'dsn' => 'sqlsrv:Server=abc/inst;database=mydb',	


'username' => 'xx',


'password' => 'secret',   	


];

/basic/web/index.php?r=gii Model Generator returns:

Invalid configuration:

Missing required parameter “dsn” when instantiating “yii\db\mssql\SqlsrvPDO”. ????

So, what class and what parameters to use ??

Any clue apreciated, thanks a lot!

greetings from brasil

uwe

Solved

how?