skip to Main Content

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.

2

Answers


  1. 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/

    Login or Signup to reply.
  2. 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

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search