How to fix WordPress Missing MySQL extension after MultiPHP upgrade on HostGator
After upgrading your WordPress site’s PHP version using the MultiPHP manager to use PHP 7, you might be running into the following error:
Your PHP installation appears to be missing the MySQL extension which is required by WordPress.
This is caused by an obsolete handler in your .htaccess
file.
Fixing it
- Locate your .htaccess file using the cPanel File Manager
- Create a backup of the file
- Edit the file by removing the obsolete handler, which should look like this:
# Use PHP71 as default
AddHandler application/x-httpd-php71 .php
<IfModule mod_suphp.c>
suPHP_ConfigPath /opt/php71/lib
</IfModule>
Code language: plaintext (plaintext)
OR
#Use PHPedge as default
AddHandler application/x-httpd-php-edge .php
<IfModule mod_suphp.c>
suPHP_ConfigPath /opt/phpedge/lib
</IfModule>
Code language: plaintext (plaintext)
Save the file and the error should be gone.