Home >Backend Development >PHP Problem >What to do if php.ini does not have pdo

What to do if php.ini does not have pdo

PHPz
PHPzOriginal
2020-09-25 14:26:522420browse

The solution to the problem that php.ini does not have pdo: first find and open the "php.ini" file; then add the configuration content as "extension=php_pdo.dll extension=php_pdo_mysql.dll"; finally restart apache.

What to do if php.ini does not have pdo

Recommended: "PHP Video Tutorial"

PHP opens PDO_MySQL extension

PHP in lower versions has PDO.Dll, but not PDO_MySQL.Dll, because it is not supported by default, so it is necessary to add it manually.

First, place the pdo_mysql.dll file in the ext directory under the PHP installation root directory

Note that if you configure other directories as extension directories in the php.ini file, then It needs to be placed under the configured directory. Which directory is your PHP extension directory? You need to look at extension_dir = "D:/PHP/php5/ext" in the php.ini file. Which directory is pointed after extension_dir in this line? , that is, which directory to look for PDO_MySQL.Dll.

Then search for "pdo" in the php.ini file. You can find the line ;extension=php_pdo.dll at once and see if there is a semicolon in front of this line. If there is, remove it.

Then look for extension=php_pdo_mysql.dll. If so, remove the preceding semicolon as well.

If not, add it manually. The final two lines of configuration content are as follows:

extension=php_pdo.dll
extension=php_pdo_mysql.dll

Save the php.ini file, restart apache or IIS, and use the phpinfo function to observe whether there is the pdo extension. Under normal circumstances, you can view it normally.

The above is the detailed content of What to do if php.ini does not have pdo. 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