phpMyAdmin: Cannot load mysql extension. Please check your PHP configuration

The “Cannot load mysql extension. Please check your PHP configuration” error in phpMyAdmin usually occurs when the MySQL extension is not enabled in PHP. Here are some steps you can take to fix this error:

  1. Check if the MySQL extension is installed: You can check if the MySQL extension is installed on your system by running the following command:
    php -m | grep mysql

    This will show a list of installed PHP modules, and if the MySQL module is not listed, it means it is not installed.

  2. Install the MySQL extension: If the MySQL extension is not installed, you can install it using the package manager on your system. For example, on Ubuntu or Debian, you can install the extension by running the following command:
    sudo apt-get install php-mysql

    This will install the MySQL extension for PHP.

  3. Enable the MySQL extension: If the MySQL extension is installed but not enabled, you can enable it by adding the following line to your PHP configuration file (php.ini):
    extension=mysql.so

    You can find the location of the php.ini file by running the following command:

    php --ini

    This will show the location of the php.ini file that is being used.

  4. Restart the web server: After enabling the MySQL extension, you need to restart the web server to apply the changes. For example, on Ubuntu or Debian, you can restart Apache by running the following command:
    sudo service apache2 restart

    This will restart Apache and load the MySQL extension.

By following these steps, you should be able to fix the “Cannot load mysql extension. Please check your PHP configuration” error in phpMyAdmin and enable the MySQL extension for PHP.

Leave a Comment