views:

331

answers:

3

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
It is not so. ccccccc
Itay Moav
+3  A: 

Enable error reporting using the following PHP code:

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

PHP Docs

scompt.com
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
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
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