How to bypass HTTP ERROR 500 page, write errors to browser

Problems with the Mac OS X version of XAMPP, questions, comments, and anything related.

How to bypass HTTP ERROR 500 page, write errors to browser

Postby macloo » 14. January 2023 16:20

Me: XAMPP 8.2.0-0 on Mac OS 10.15.7. Problem: In previous versions (not VM), I used the following script to write error messages into the browser window. It has worked perfectly for several years now. This is helpful for beginners (my students) who are unfamiliar with error logs.

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):

Image

.
macloo
 
Posts: 5
Joined: 16. January 2018 16:09
XAMPP version: 7.2.0-0
Operating System: OSX

Return to XAMPP for macOS

Who is online

Users browsing this forum: No registered users and 118 guests