Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

On PHP Error Apache gives 500 Error

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.

like image 903
trobrock Avatar asked Jul 28 '09 03:07

trobrock


People also ask

What is HTTP Status 500 in Apache Tomcat?

HTTP Status 500 – Internal Server Error Description The server encountered an unexpected condition that prevented it from fulfilling the request.

How can I make PHP display the error instead of giving me 500 Internal server error?

Check the error_reporting , display_errors and display_startup_errors settings in your php. ini file. They should be set to E_ALL and "On" respectively (though you should not use display_errors on a production server, so disable this and use log_errors instead if/when you deploy it).


1 Answers

Enable error reporting using the following PHP code:

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

PHP Docs

like image 146
Edward Dale Avatar answered Oct 08 '22 20:10

Edward Dale