[RESOLVED] Error: “Cannot load mysql extension. Please check your PHP configuration”

Error: “Cannot load mysql extension. Please check your PHP configuration”.

  1. Bhawani Singh
    Are you getting this error while loading PhpMyAdmin on your new server? If you are getting the error “Cannot load mysql extension. Please check your PHP configuration” after installing PhpMyAdmin then you will need to install php-mysql. Now the question arises why php-mysql needed.

    php-mysql is a module of for PHP applications and this module use mysql databases. So it’s essential to install php-mysql with PhpMyAdmin. If you need to work with PhpMyAdmin then you have to also install following PHP application:
    • php-mysql : It’s a module which is used for PHP applications and also used for MySQL databases.
    • php-gd : Here gd shows graphics library and it’s also a module for PHP.
    • php-mbstring : This is also a module for PHP applications which want multi-byte string handling.
    • php-mcrypt : It’s a Standard PHP module which provides mcrypt library support.
    Now install php-mysql with the following command:

    Code:
    # yum -y install php-mysql
    
    # service httpd graceful
    php-mysql is already comes with /etc/php.d/mysql.ini file, so there is no need to edit the file /etc/php.ini.

    Code:
    # cat /etc/php.d/mysql.ini
    Here is the sample output:

    Code:
    ; Enable mysql extension module
    extension=mysql.so
    At last you can install other modules with the following commands:

    Code:
    # yum -y install php-mbstring php-mcrypt php-gd
    # service httpd restart