yii框架入门,总是出错 [ 新手入门 ]
exception 'CDbException' with message 'CDbConnection failed to open the DB connection: could not find driver' in
共 6 条回复
-
找到config 文件再找到console.php文件,将里的配置写正确:如下
// This is the configuration for yiic console application. // Any writable CConsoleApplication properties can be configured here. return array( 'basePath'=>dirname(__FILE__).DIRECTORY_SEPARATOR.'..', 'name'=>'My Console Application', // application components 'components'=>array( 'db'=>array( 'connectionString' => 'mysql:host=localhost;dbname=test', 'emulatePrepare' => true, 'username' => 'root', 'password' => '', 'charset' => 'utf8', 'tablePrefix' => 'tbl_', 'enableParamLogging' => YII_DEBUG,//供debug使用 'enableProfiling' => YII_DEBUG,//供debug使用 ), ), );
-
credochen 福州
注册时间:2011-09-20
最后登录:2016-02-14
在线时长:0小时49分
最后登录:2016-02-14
在线时长:0小时49分
- 粉丝0
- 金钱180
- 威望0
- 积分180