错误:您的PHP安装似乎缺少WordPress所需的MySQL扩展

I'm new to wordpress. After uploading the website i'm facing this error. The site worked well for a while and then this happened. Upon entering the URL this text appears "Your PHP installation appears to be missing the MySQL extension which is required by WordPress". Went to php.ini but couldnt find what to uncomment. Please advise in the best way possible. Server - Xampp

The error you got Your PHP installation appears to be missing the MySQL extension which is required by WordPress is because you're server is not having the MySQL Extension which is required for Wordpress to run

If you are using Windows Based Operating System then you should enable the mysql extension in your xampp

i.e., You should uncomment the following lines in your php.ini

extension=php_mysql.dll

Or If you use Linux based Operating System then you should install mysql from the Terminal by

sudo apt-get install php5-mysql

and then uncomment the following line in you php.ini

extension=mysql.so 

Note :

  1. What ever the Operating System you use, You should restart / stop and start your Xampp Server after uncommenting the php.ini file

  2. If you're working online then you should contact your host provider to enable the MySQL Extension for your Account.

In Windows, you need to setup your php.ini like this:

  • uncomment the line extension=php_mysqli.dll

  • find the "extension_dir" parameter and set the path to ext directory of your php installation, like this:

    extension_dir = "c:/php56/ext"

Login to your c panel Got to PHP Configuration Select your current PHP Version ( You can know this from phpinfo) Click update

To solve this problem is to config this Wordpress file wp-config-sample.php form your Wordpress folder on your machine which looks like this C:\xampp\htdocs\wordpress\wp-config-sample.php

enter image description here

Then you save it as wp-config.php reload your browser every thing should work well.

In the folder where you have installed the php, try to find the "php.ini". Now you should have delete the " ; " from this rows.

 ; extension=mysqli
 ; extension=pdo_mysql