Home >PHP Framework >YII >An error message appears when creating a model in yii
Problem:
Such an error occurs when using gii in Yii to create a Model:
CDbConnection failed to open the DB connection: could not find driver
Cause analysis:
This It's because the PDO extension is not enabled in your php.ini file.
(Recommended related article tutorials: yii framework)
Solution:
Just turn on the extension.
;extension=php_pdo.dll ;extension=php_pdo_mysql.dll
Remove the two semicolons here.
Of course, the prerequisite for this is that you have installed the PDO extension on the Linux server, and then opening the comments in php.ini will be effective.
For more programming related content, please pay attention to the Programming Introduction column on the php Chinese website!
The above is the detailed content of An error message appears when creating a model in yii. For more information, please follow other related articles on the PHP Chinese website!