Induce a HTTP 500 error in PHP for testing custom error pages

When testing a custom error page in Apache, you may want to induce a HTTP 500 Internal Server Error. The simplest way to do this is to create a new php file with the following contents:

The code will raise an exception, resulting in a regular HTTP 500 error page. If you have custom […]
Continue reading…