Home » Php » On PHP Error Apache gives 500 Error

On PHP Error Apache gives 500 Error

Posted by: admin July 12, 2020 Leave a comment

Questions:

Everytime I get an error in any of my PHP, my local Apache server gives me a 500 Internal Server error. I never seem to have problems with any of my CakePHP projects, but this is plain vanilla PHP and it is really slowing down progress having to guess at the error.

How to&Answers:

Enable error reporting using the following PHP code:

 ini_set('display_errors','On');
 error_reporting(E_ALL);

PHP Docs

Answer:

What @scompt wrote + you can always check the Apache error logs to know what happened. (hell, if you develop on linux, host on Linux, you must be familiar with the error logs).