I’m running yii on my local machine on WAMP. I also have a database which is installed with MS SQL Server 2008 R2
Normally I run yii with a mysql database but now I’m trying to set up yii on MS SQL server
config =
‘db’=>array(
‘connectionString’ => ‘sqlsrv:server=localhost;database=NEIL’,
// ‘emulatePrepare’ => true,
‘username’ => ‘xxxxx’,
‘password’ => ‘xxxx’,
When I run ?=gii to create model, controller and CRUD code I’m getting the following error message at this code:
public function init()
56 {
57 if(Yii::app()->{$this->connectionId}===null)
58 throw new CHttpException(500,‘A valid database connection is required to run this generator.’);
59 $this->tablePrefix=Yii::app()->{$this->connectionId}->tablePrefix;
60 parent::init();
61 }
This is the error message:
CDbConnection failed to open the DB connection: SQLSTATE[IMSSP]: This extension requires the Microsoft SQL Server 2012 Native Client ODBC Driver to communicate with SQL Server. Access the following URL to download the Microsoft SQL Server 2012 Native Client ODBC driver for x86: http://go.microsoft…/?LinkId=163712
I have downloaded an installed these sqlsrv drivers.
extension=php_pdo_sqlsrv_53_ts.dll
This is what my phpinfo says:
pdo_sqlsrv
pdo_sqlsrv support enabled
Directive Local Value Master Value
pdo_sqlsrv.client_buffer_max_kb_size 10240 10240
pdo_sqlsrv.log_severity 0 0
I have also installed the Microsoft ODBC Driver 11 for SQL Server.
However I didn't configure this ODBC driver in any way. I only installed.
Do I need to do some configuration of the driver?
Thank you in advance for your help.
Neil