- Code: Select all
<?php
$conn = mysqli_connect("localhost", "root", "", "false_db_name");
if (!$conn) {
echo "Error: Unable to connect to database. ";
echo "Debugging errno: " . mysqli_connect_errno();
echo " Debugging error: " . mysqli_connect_error();
exit;
}
?>
In previous versions of XAMPP/PHP, using "false_db_name" instead of an existing database name would result in the error text being written directly into the browser window, which is handy for beginners unused to error logs.
Now, however, I just get a generic HTTP ERROR 500 and no error messages.
I would like to go back to the old way, but I don't know how to bypass the HTTP ERROR 500 page. Here's a screenshot of what it used to do (and what I want):
.