Preface: When using the YII framework to do the project, sometimes encounter "Cdbconnection failed to open the DB connection:could not find driver" problem, this problem is usually because there is no load pdo_ Mysql.dll extension. Here's how to find the problem and fix it:
First, see if there is a pdo_mysql module in Phpinfo or enter php-m in CMD to see if the Pdo_mysql module is loaded.
Second, if the Pdo_mysql module is not found in the first step, then it is php.ini in the Extension=php_pdo_mysql.dll to remove the comments, while ensuring that the Ext folder exists php_pdo_mysql.dll the extension file. Then restart Apache and see if there is a pdo_mysql module in Phpinfo.
Note: If you have multiple PHP environments installed, be sure to determine which php.ini you are loading before modifying php.ini, either by phpinfo or by typing php--ini in cmd to see which php.ini is loaded. I was installed two PHP environment, one is integrated, a non-integrated, in the system environment variable fixed a PHP path, so the modification is wrong php.ini, has been unable to successfully load pdo_mysql~~~ pit dead baby!!!
Yii "Cdbconnection failed to open the DB connection:could not find driver" workaround