Hi there,
I’ve got a WAMP setup (work machine…) version 2.2 with PHP 5.3.13 with MSSQL and PDO_MSSQL loaded. I’ve looked at quite all the topics on this forum but could not resolve my problem:
CDbConnection failed to open the DB connection: could not find driver
I’ve tried different connectionStrings, none work, I ended up with:
'db' => array(
'connectionString' => 'mssql:host=127.0.0.1;dbname=Yiitest',
'username' => 'UltraPhil',
'password' => '...',
'charset' => 'utf8',
'emulatePrepare' => false,
),
2012/08/13 19:53:51 [error] [exception.CDbException] exception 'CDbException' with message 'CDbConnection failed to open the DB connection: could not find driver' in C:\wamp\www\yii-1.1.11.58da45\framework\db\CDbConnection.php:382
Stack trace:
#0 C:\wamp\www\yii-1.1.11.58da45\framework\db\CDbConnection.php(331): CDbConnection->open()
#1 C:\wamp\www\yii-1.1.11.58da45\framework\db\CDbConnection.php(309): CDbConnection->setActive(true)
#2 C:\wamp\www\yii-1.1.11.58da45\framework\base\CModule.php(388): CDbConnection->init()
#3 C:\wamp\www\yii-1.1.11.58da45\framework\base\CModule.php(104): CModule->getComponent('db')
#4 C:\wamp\www\yii-1.1.11.58da45\framework\gii\generators\model\ModelCode.php(56): CModule->__get('db')
#5 C:\wamp\www\yii-1.1.11.58da45\framework\web\CFormModel.php(40): ModelCode->init()
#6 C:\wamp\www\yii-1.1.11.58da45\framework\gii\CCodeGenerator.php(154): CFormModel->__construct()
#7 C:\wamp\www\yii-1.1.11.58da45\framework\gii\CCodeGenerator.php(64): CCodeGenerator->prepare()
#8 C:\wamp\www\yii-1.1.11.58da45\framework\web\actions\CInlineAction.php(50): CCodeGenerator->actionIndex()
#9 C:\wamp\www\yii-1.1.11.58da45\framework\web\CController.php(309): CInlineAction->runWithParams(Array)
#10 C:\wamp\www\yii-1.1.11.58da45\framework\web\CController.php(287): CController->runAction(Object(CInlineAction))
#11 C:\wamp\www\yii-1.1.11.58da45\framework\web\CController.php(266): CController->runActionWithFilters(Object(CInlineAction), Array)
#12 C:\wamp\www\yii-1.1.11.58da45\framework\web\CWebApplication.php(283): CController->run('')
#13 C:\wamp\www\yii-1.1.11.58da45\framework\web\CWebApplication.php(142): CWebApplication->runController('gii/model')
#14 C:\wamp\www\yii-1.1.11.58da45\framework\base\CApplication.php(162): CWebApplication->processRequest()
#15 C:\wamp\www\yiitest\index.php(13): CApplication->run()
#16 {main}
REQUEST_URI=/yiitest/index.php/gii/model
HTTP_REFERER=localhost/yiitest/index.php/gii
As I said, I already read a lot of other threads, and I still can’t resolve this one.
Thanks!