Database connection failed could not find driver
When debugging a PHP program, reported this error, could not find driver
After a search, combined with their own thinking and practice, finally found the problem.
Originally I used the PDO object in this program, connected to MySQL 5. In PHP's default settings, only the Php_pdo module is turned on, and the Php_pdo_mysql module is not opened. This is why you cannot find the driver error.
Modify PHP.ini
Extension=php_pdo.dll
Extension=php_pdo_firebird.dll
Extension=php_pdo_mssql.dll
Extension=php_pdo_mysql.dll
Restart Apache for you. Of course, if you use a different database, open the corresponding module is OK.
If under Linux, make sure the module pdo_mysql.so has been compiled into PHP.
Add the following php.ini:
Extension=pdo_mysql.so
Bill: PHP database connection failed--could not find driver workaround