我已经在我的机器上成功安装了 YII 框架,并使用 YII 的终端命令创建了一个新的应用程序。
YiiRoot/framework/yiic webapp helloworld
在我的 Web 服务器上创建了名为 helloworld 的目录。从那里我将数据库连接从 SQLlite 更改为 MySql。
'db'=>array(
'connectionString' => 'mysqli:host=localhost;dbname=yii_amar',
'emulatePrepare' => true,
'username' => 'root',
'password' => 'redhat456',
'charset' => 'utf8',
'tablePrefix' => '',
),
当我使用命令在我的 YII 终端中测试数据库连接时。
protected/yiic shell
然后使用此命令测试数据库连接。
echo Yii::app()->db->connectionString;
它给了我错误。
exception 'CDbException' with message 'CDbConnection failed to open the DB connection: could not find driver' in /root/Desktop/htdocs/ayii/framework/db/CDbConnection.php:381
谁可以帮我这个事。