WHMCS Suddenly stopped working

235 Views Asked by At

I am using WHMCS lifetime license but it suddenly stopped working now it's showing could not connect to database which seems false to me..

My mysql server is up i have tested same db credentials in a new connectivity file . Everything is working perfectly.

Though WHMCS staff is saying it's db issue.. Kinda joke for me..

If anyone else is facing same issue. Please help thanks.

1

There are 1 best solutions below

2
mrkoopie On

You can create the following file in the root directory of your WHMCS installation as test_db_configuration.php:

<?php
include('configuration.php');

try{
    $db = new PDO("mysql:host=".$db_host.";dbname=".$db_name, $db_username, $db_password);
    echo 'Connected to the MySQL server.';
}
catch(PDOException $ex){
    echo 'Unable to connect: <strong>'. $ex->getMessage();'</strong>';
}

Save the file and open https://your-client-area/test_db_configuration.php. If it works, you will see the text Connected to the MySQL server. in your browser. Otherwise, the cause will be shown.

If the script is unable to connect, check if there are any errors found in the database log. Usually they are in /var/lib/mysql/hostname.err or in /var/log/mysql. If no error is to be found, you can check if error logging is enabled in MySQL or configure your my.cnf to log them in the desired location.