0

enter image description hereI'm trying to connect replit.com (the cloud based IDE I'm using) and database from remotemysql.com. I only get "HTTP ERROR 500". How do I fix this? Any reply may help. Thanks.

Here is my code on mysqli_connect.php file (I hided username, dbname and password):

<?php 
$host = "remotemysql.com"; 
$user = "xxxxxxxxx"; 
$pass = "xxxxxxxxx"; 
$db = "xxxxxxxxx"; 
$port = 3306; 

//problem on this line below
$connection = mysqli_connect($host, $user, $pass, $db, $port); 
if(mysqli_connect_errno()) { 
die("Database connection failed: " . mysqli_connect_error() . " (" .mysqli_connect_errno() . ")" ); 
} else { 
echo "connection made"; 
} 
?>
Amanda Ip
  • 1
  • 2
  • 1
    500 error is a generic error, by itself it's (deliberately) meaningless. Check the PHP error log on the server to find out the underlying exception. (P.s. did you Google PHP 500 error before asking? If you did you'd probably have discovered this advice already, much faster) – ADyson Apr 03 '21 at 11:06
  • Thanks for the error message. Seems like maybe your PHP did not have the mysqli extension installed and/or configured. You can find info online already about how to enable it. – ADyson Apr 03 '21 at 15:27
  • Thanks for the tips. – Amanda Ip Apr 03 '21 at 20:50

0 Answers0