Home  >  Article  >  Backend Development  >  What should I do if php7 cannot find the pdo extension?

What should I do if php7 cannot find the pdo extension?

藏色散人
藏色散人Original
2021-12-31 09:14:302653browse

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.

What should I do if php7 cannot find the pdo extension?

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!

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