I have a few domains hosted with Hostgator written using PHP 5.x. I recently received an email informing me update my code to PHP 7.x. The only major thing I had to do was to use mysqli instead of mysql. After testing my code on my local environment, I decided to FTP the code to a sub domain configured to use PHP 7.4. When I started testing the code on Hostgator, I saw in the error logs the following error:
Fatal error: Uncaught Error: Call to undefined function mysqli_connect()
If you click on the following link, you will see that the domain upgrade.inglesdaganzo.com is using PHP 7.4:
http://upgrade.inglesdaganzo.com/phpinfo.php
The thing is that I don't see that the mysqli extension is actually enabled, I don't see the usual information regarding the mysqli module/extension.
If you click on this link, you will see the error:
http://upgrade.inglesdaganzo.com/index.php
The php contained in index.php is this:
if (!function_exists('mysqli_connect')){
echo "ERROR function 'mysqli_connect' was not found. It seems that the mysqli extension is not enabled ";
//Do this so that Hostgator can see the error
mysqli_connect("localhost","a_user","a_password");
}else{
echo "GREAT 'mysqli_connect' was found";
}
I've been on to Hostgator a number of times and they say it's my problem and that it's all good at their end. They have configured PHP 7.4 correctly on their servers and that the problem is with my code. I really don't know what to do now.