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.
A:
PHP errors shouldn't be triggering 500 errors - the most common case for those are bad .htaccess files. What sort of PHP errors is this happening on, all of them?
whichdan
2009-07-28 03:19:30
It is not so. ccccccc
Itay Moav
2009-07-28 03:20:49
+3
A:
Enable error reporting using the following PHP code:
ini_set('display_errors','On');
error_reporting(E_ALL);
scompt.com
2009-07-28 03:20:03
Thanks, that did it. So I could go into the php.ini file and set this also correct? So I don't have to have this code in my file all the time.
trobrock
2009-07-28 03:22:13
Why shouldn't you have it, put it under an 'if' statement that is turned on in development (or production in an emergency, as you wouldn't want to shutdown the server for that). Check also my answer below.
Itay Moav
2009-07-28 03:24:21
A:
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).
Itay Moav
2009-07-28 03:22:36