My site has been working for 3 years perfectly and I have not made any change recently, neither to the site or database. But today it suddenly shows "Internal Server Error". I have been testing and it only fails when trying to connect to database (MySQL). Database is accessible from MySQLWorkbench or even from another site. I also have been tested with different databases. Site fails when trying to connect:
$conn = new mysqli($servername, $username, $password, $dbname);
I also have been testing with this:
$conn = mysqli_connect($servername, $username, $password, $dbname);
Also, I changed to PDO:
$mysql_connect_str = "mysql:host=$dbhost;dbname=$dbname; charset=utf8";
$dbConnection = new PDO($mysql_connect_str, $dbuser, $dbpass);
But none of those worked. There's not even need to execute a query or insert; only one of those lines is enough to fail and show Internal Server Error. Unfortunately I can't access to logfile since I'm working in a shared hosting. Can you please help me?