but I have installed Windows Server 2008 R2 to another PC
Xampp version: 1.7.0
PHP: 5.2.8
and this works!!!
I think the problem is that I have php_pdo_mssql.dll extension is not right version for Windows 7. And I couldn’t find. Because this code give me same error. It is simple php code.
If phpinfo() says “Installed PDO Drivers — mssql, mysql, sqlite2” and you don’t have the .dll it probably means that it was compiled into the PHP executable. The link I provided above may have what you need in version 2.0 but since your PHP is so old it may no longer be supported.
I normally don’t use XAMPP but rather use the Windows native tools directly so I can’t help you much there; perhaps upgrading to a newer XAMPP will solve your problem.
What does <?php phpinfo(); ?> or the Yii requirements checker page say about the PDO drivers? Are they installed?
The other thing you might be missing is the DB instance on the connection string, as in ‘connectionString’=>‘sqlsrv:server=hostname\SQLEXPRESS;database=db_name’.