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