Share via:

HTTP 500 Internal Server Error

The 500 Internal Server Error is usually sent to indicate a problem on the server-side.

28 views

Edited: 2020-01-05 02:14

A 500 Internal Server Error is often delivered when there is an error with the servers configuration, but it can also be delivered intentionally as a custom error by a server-sided application.

A 500 response looks like this in plain text:

HTTP/1.1 500 Internal Server Error

To send a custom 500 response code in PHP, use the http_response_code function:

http_response_code(500);
echo '<h1>500 Internal Server Error</h1>';

To instead send the raw headers see: The PHP Header Function

Comments