How to fix the missing MySQL extension error on WordPress?

Here we have shared the method to fix the “your PHP installation appears to be missing the MySQL extension which is required by WordPress” warning/error. Before having a look at the method, let’s first understand the importance of extensions. The WP content management system is powered by PHP. For those who are not aware, PHP supports extensions. With the help of an extension, you can add support for things that are not supported by the plain PHP installation. For example, your WordPress won’t connect to the MySQL database service if you don’t install the PHP MySQL extension. Similarly, the WP site may not support images of a certain format if you don’t install the PHP GD extension.

WordPress Site Health - missing modules packages PHP warning/error

Earlier versions of WordPress didn’t show errors or warnings when one of the required extensions was missing but now you can see the warning on the WordPress content management system’s site health page. The option to open this page appears under the “Tools” menu that you will find in the WP dashboard sidebar. This page has an accordion that shows various issues that you can or you must address for the smooth functioning of your website. If any PHP module is missing, you’ll find the block “one or more module is missing” in the accordion. When you click this block, you’ll find a list of extensions/modules that you must install.

To install the extensions, login to the server via SSH and run one of these commands:

apt install php-extension-name on Debian server

dnf install php-extension-name on Fedora or Ubuntu server

pacman -s php-extension-name on Arch Linux server

If you see this error/warning “unable to locate package”, use the Debian package search utility to locate the package, arch repository to find the package, or run the command yum search package-name in the terminal. Once you find the package, enter its name as it is in the above commands. When the package has been installed, reload or restart PHP to get rid of the “your PHP installation appears to be missing the MySQL extension which is required by WordPress” warning.

Closing words: With the above methods, you can not only fix the missing MySQL extension but also fix issues related to various other extensions required by WP themes or plugins.


Pramod is the founder of wptls. He has been using WordPress for more than nine years. He builds web applications, and writes about his experiences with various WP products on this site.

Leave a Reply

Your email address will not be published. Required fields are marked *