Home >Backend Development >PHP Problem >What should I do if php cannot enable the mysql extension?
The solution to the problem that php cannot open the mysql extension is to edit the php.ini configuration file and remove the semicolon in front of php_pdo_mysql.dll. Then set the extension directory in the php.ini file. Finally, add the php path to the apache configuration file.
The operating environment of this article: windows10 system, php 7.3, thinkpad t480 computer.
After upgrading php7, the following problem occurred when opening the applet:
Here I have removed extension=php_pdo_mysql in php.ini. ";"
in front of dll and add extension_dir = "E:\softwares\wamp\php-7.1.8_VC14"
E:\softwares\wamp\php in php.ini -7.1.8_VC14 is your php path, and php_pdo_mysql.dll exists in the ext folder.
If there are no problems with the above, it is very likely that there is a problem with our apache configuration file.
Solution:
We only need to add the PHP path PHPIniDir "D:/php" to the apache configuration file httpd.conf.
Learning video related tutorials: php video tutorial
The above is the detailed content of What should I do if php cannot enable the mysql extension?. For more information, please follow other related articles on the PHP Chinese website!