June 11th, 2008 at

No errors with php5

in: Topics

If you are battling with a php application using php5 which is showing no errors then your experiencing what many have. 

For some reason; most probably security, the standard setting for errors in PHP5 is "off".

 All well and good for those who don't want to see there errors but for debugging its a total nightmare but there is a line of code which can help.

 ini_set('display_errors','On');

This line of code will display all php errors which can also be a little annoying.  I like the balance of hiding the not so problematic errors with these two lines of code.

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

What your doing here is telling php to display errors, then limiting the errors to only the more important ones which seems to work for most.

 

RSS feed for comments on this post | TrackBack URI