PHP is the programming language we use to build and maintain WordPress. Newer versions of PHP are both faster and more secure. If WordPress detected that your site is running on anversion, you will be prompted to update. In an previous guide, we showed

**how to update PHP version for WordPress sites with Hostgator web hosting Hostgator offers either PHP Selector or MultiPHP Manager plugin depending on your server to manage the PHP version for your site.

If you previously used the PHP Selector to upgrade the PHP version to a newer version, and then recently used the new MultiPHP Manager plugin to update PHP, you may have this error on your site.

Warning: Use of undefined constant WP_CONTENT_DIR – assumed ‘WP_CONTENT_DIR’ (this will throw an Error in a future version of PHP) in /home1/xxxx/public_html/wp-includes/load.phpon line 115

Your PHP installation appears to be missing the MySQL extension which is required by WordPress.

This error is caused by the duplicate handler in the .htaccess file and can be easily fixed by following the steps below.

== Back up the .htaccess file ==

Log into the cPanel with Hostgator. Go to Websites > Files > File Manager. Locate the document root for your domain or website. If you host only one website in the hosting account, its default root is usually the

**public_html** folder. If you are doing this for a subdomain or an addon domain, find the document root for that domain instead. The .htaccess file can be found at the site root director. Create a new folder in the root. Then right click on the .htaccess file, select Copy from the context menu, then enter the file path, type in the new folder name to copy this configuration file to. You can also download a copy of this file from your server to your local computer as a backup.

== Edit .htaccess file ==

In the File Manager, right-click on .htaccess, select Edit from the context menu, and then click Edit again from the pop-up window. In your .htaccess file, click the Search button, type in ‘addhandler’, you should find two entries for PHP handlers.

![ Fix the missing WordPress required MySQL extension error with Hostgator](httpsi0.wp.com/www.betterhostreview.com/wp-content/uploads/2020/09/edit-htaccess-fix-missing-wordpress-mysql-extension-error-hostgator.jpg?resize=700%2C616&ssl=1)

The old one you’ll need to remove will look like one of these:


# Use PHP71 as default AddHandler application/x-httpd-php71 .php  suPHP_ConfigPath /opt/php71/lib 

or

#Use PHPedge as default AddHandler application/x-httpd-php-edge .php  suPHP_ConfigPath /opt/phpedge/lib 

The new one you want to keep will look like the one below.

# php -- BEGIN cPanel-generated handler, do not edit # Set the “ea-php74” package as the default “PHP” programming language.  AddHandler application/x-httpd-ea-php74 .php .php7 .phtml  # php -- END cPanel-generated handler, do not edit

Click

**Save Changes** and then **Close** to close the editor. Try to reload your website from browser see if the error is gone.

 Bonus tips 

- If your .htaccess file has more then one old PHP Handler entry, you should disable all those outdated PHP handlers and have only one entry.

- If your site is still displaying the missing WordPress required MySQL extension error, search for another .htaccess file

aboveyour website’s document root. Open that .htaccess and check if there is a PHP handler in there and disable it. Again, you may duplicate or backup the .htaccess file before you editing it.