cPanel with the PHP selector shows WordPress Error & ldquo; the PHP installation seems to be missing the MySQL extension that is required by WordPress & rdquo;


After an upgrade of MySQL to use MariaDB 10, multiple sites on my CloudLinux cPanel server are just white screens with Error: Your PHP installation appears to be missing the MySQL extension which is required by WordPress

I can choose the PHP version per account, but selecting any from 5.3 up to 5.6 still doesn't work.

Nothing is working, rebuilding Apache and PHP using /scripts/easyapache/ is not working, and running <?php echo phpinfo(); ?> on the failing sites shows there is no mysql or mysqli extension.

How can this be fixed?

This may NOT require big rebuilds or reinstallation of PHP/MySQL if you are running MySQL/MariaDB on your cPanel server - which is quite likely if you are running 64-bit CloudLinux.

It might just be broken symlinks to the modules.

If you log into WHM and search for "MariaDB" you may find an option "MySQL/MariaDB Upgrade" - this means you are using it. Alternatively you can just ask your host if MySQL/MariaDB is the database management system.

If you are using MariaDB, an upgrade may have broken symlinks to, and

Only attempt the following if you have root access via the command line and know what you are doing - otherwise ask your host to do it.

Create a file called info.php in the web root of your broken site, with the following code:

    $inipath = php_ini_loaded_file();

    if ($inipath)
        echo 'Loaded php.ini: ' . $inipath;
    } else
        echo "No php.ini - MariaDB symlinks are NOT the problem";

This will give you the path to the php.ini file of PHP build you are using when you navigate to

In my case it showed /opt/alt/php55/etc/php.ini

This is PHP 5.5 which has been selected via the PHP selector in cPanel. The first part of this: /opt/alt/php55/ shows where we need to look in the next step.

Now, log in via the command line and run:

cd /opt/alt/php55/usr/lib64/php/modules
ls -la

Look down the list and see if you can find something like: -> /opt/alt/php55/etc/mysql10/

If what appears between /etc/****/ is not mariadb10 (or whatever version of MariaDB you are running) then you need to rebuild the symlinks.


ln -s /opt/alt/php55/etc/mariadb10/ /opt/alt/php55/usr/lib64/php/modules/
ln -s /opt/alt/php53/etc/mariadb10/ /opt/alt/php55/usr/lib64/php/modules/
ln -s /opt/alt/php53/etc/mariadb10/ /opt/alt/php55/usr/lib64/php/modules/

Then you may need to do the same for other PHP versions available via the PHP selector. In my case this involved also repairing:


It was a complete horror story, but very easily fixed in the end (after rebuilds and other dead-end avenues).