Home  >  Article  >  PHP Framework  >  An error message appears when creating a model in yii

An error message appears when creating a model in yii

王林
王林Original
2020-02-20 15:05:032237browse

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn