'MAMP Pro showing server internal 500 error on PHP throw new Exception
Just for the record, here's the error I'm getting (don't stop reading there):
Oops! An Error Occurred The server returned a "500 Internal Server Error". Something is broken. Please let us know what you were doing when this error occurred. We will fix it as soon as possible. Sorry for any inconvenience caused.
Before you jump to the usual conclusions, let me tell you that I traced the error to; a line like:
throw new \Exception("Some value not recognized: $someVar");
Normally Exceptions work fine; I can't tell why this one's so weird.
$someVar isn't storing anything weird, just a string like "Hi, I am a string". The Exception running actually makes sense with the input I tested. What I'm unable to figure out is why the 500 error is happening, and why there's no logs for it, and why anything I try doesn't solve the problem or give me any clue what to do next.
I already tried enabling PHP errors, across many files, even up to the line right before the Exception line:
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
MAMP's Apache logs and PHP logs show nothing for it, just earlier unrelated stuff.
MAMP appears to not have its own log files, so I can't see what's actually failing.
For some reason, something is triggering the 500 error, and all I'm seeing is another brick in the wall.
My MAMP Pro (paid) version is 6.6.2, my macOS is Monterey, Apache 2.4, PHP 7.4 (sorry, we're trying to upgrade), and everything's been working fine until today.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
