my website recently crashed and is no longer available. I browsed through my Cpanel dashboard and I found error logs file in which I noticed my website is crashing due to call to undefined function mysqli_connect. Website is using PHP version 7.4. I tried downgrading PHP version myself but it didn’t help. Does anyone have any suggestions on how to fix this using c panel.
Question posted in PHP Versions
You can find a list of all versions here.
You can find a list of all versions here.
2
Answers
Try this in any test php file
echo phpinfo();
and look for mysqli extension if its disabled.
This fatal error comes when mysqli extension is disabled.
you can set it explicitly from php.ini for version you selected from cpanel.
for more information look here https://forums.cpanel.net/threads/how-to-enable-mysqli.142737/
this problem has nothing to do with the cpanel
The problem is with the server PHP settings
You can rewrite the connection section with PDO
read more :
https://www.w3schools.com/php/php_mysql_connect.asp