I am new to yii
and have a site built in yii 1.1.x
with 2 MSSQL2014
dbs one local and one residing in a remote server. I have used standard yii
connection string in main.php
as below:
'db'=>array(
'class'=>'CDbConnection',
'connectionString' => 'sqlsrv:Server = '.$dbServer_t.'; Database = '.$dbName_t.'',
'username' => $dbUser_t,
'password' => $dbPass_t,
'charset' => 'utf8',
),
The site seems to work fine with domain name mydomain.com
but when running as www.mydomain.com
the site is showing the following error
CDbConnection failed to open the DB connection: SQLSTATE[28000]: [Microsoft][ODBC Driver 11 for SQL Server][SQL Server]Login failed for user 'xxxxxx'.
I have checked separately in a test file outside yii
directory with simple connection string for MSSQL
and its working fine with both www and non www version. So it appears definitely somehow the issue is with yii
and somehow its restricting db connection for www version.
Can anyone please help how to fix that?