Android Question PHP Fatal error: Uncaught Error: Call to undefined function mysqli_connect ()

WebQuest

Active Member
Licensed User
Hello,
Last week an unknown entity hacked my my site, after solving the problem with the service provider I get an error: ResponseError. Reason:, Response:.
Use of php scripts to make my app communicate with the database in phpMyAdmin on my web space. Initially I reconfigured the .htacces file to make Apache run php7.4. Now when the app is debugging I get the error from the server [17-Jul-2022 12:41:32 UTC] PHP Fatal error: Uncaught Error: Call to undefined function mysqli_connect () in Directory ...


Until now everything worked.

I use the following script to get row from database:

PHP:
<?php
$databasehost = "localhost";
$databasename = "xxxxxx";
$databaseusername ="xxxxxx";
$databasepassword = "xxxxxxx";

$con = mysqli_connect($databasehost,$databaseusername,$databasepassword, $databasename) or die(mysqli_error($con));
mysqli_set_charset ($con , "utf8");
$query = file_get_contents("php://input");
$sth = mysqli_query($con, $query);

if (mysqli_errno($con)) {
   header("HTTP/1.1 500 Internal Server Error");
   echo $query.'\n';
   echo mysqli_error($con);
}
else
{
   $rows = array();
   while($r = mysqli_fetch_assoc($sth))
   {
     $rows[] = $r;
   }
   $res = json_encode($rows);
    echo $res;
    mysqli_free_result($sth);
}
mysqli_close($con);
?>

any advice will be appreciated
 

WebQuest

Active Member
Licensed User
Hello peacemaker,
I cannot reactivate I have to reinstall mysqli() on the server because my webspace package does not allow me to access the terminal. I have contacted support but I am not allowed to physically access. What alternative do I have?
 
Upvote 0

peacemaker

Expert
Licensed User
Longtime User
Ask support to help - if server's side was hacked (how did you found it ?) - the hoster of shared hosting must help
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
Upvote 0
Top