Home > Article > Backend Development > What should I do if php7 cannot find the pdo extension?
php7 cannot find the solution to the pdo extension: 1. Open php.ini; 2. Remove the semicolon before "extension=php_pdo_mysql.dll"; 3. Add PHP to the apache configuration file httpd.conf Path; 4. Restart apache.
The operating environment of this article: windows7 system, PHP7.1 version, DELL G3 computer
php7 What to do if the pdo extension cannot be found ?
pdo error could not find driver in php7.1 Solution:
Record your own errors
1.
1. The reason is that there is no pdo extension.
2. Solution: Open php.ini, and then remove the semicolon (;) before the following two lines of code. . As follows;
extension=php_pdo_firebird.dll extension=php_pdo_mysql.dll
2. But when I run the pdo link, I still get this error. Finally, I found that there was a problem with my pdo link string, which made it impossible to connect. The reason is that the functions of single quotes and double quotes are not clear. PHP will not parse variables under single quotes, but PHP will parse variables under double quotes and without symbols.
Solution to the PHP7 PDO_MYSQL extension that cannot be enabled under windows:
The first step is to make sure you have removed the extension= in php.ini The ";" in front of php_pdo_mysql.dll
The second step is to make sure that extension_dir = "D:/php/ext" is added to php.ini. D:/php is your php path, and the ext folder is php_pdo_mysql.dll exists
If there are no problems with the above, then there is a problem with your apache configuration file
The third step is to add the PHP path PHPIniDir "D: /php"
Okay, restart apache, refresh and you will see pdo_mysql
Recommended learning: "PHP Video Tutorial"
The above is the detailed content of What should I do if php7 cannot find the pdo extension?. For more information, please follow other related articles on the PHP Chinese website!