I want to simulate an error 500 on a local server.
How is this done correctly?
I tried to just set the headers, but nothing was displayed in the browser.
Using the http_response_code function
// например, http_response_code(500); // или http_response_code(404);
Source: https://ru.stackoverflow.com/questions/436801/
All Articles
header('HTTP/1.1 500 Internal Server Error'); echo "<image src='$imageUrl' style='width: 100%' />";
header('HTTP/1.1 500 Internal Server Error'); echo "<image src='$imageUrl' style='width: 100%' />";
- it will be displayed. In the developer console, see, now your mistake is only there. - BOPOH