php: display errors

by prettyscripts on 2007-12-03 20:17:31

php

for security reasons, display_errors should be turned off in php.ini. this will not display the error on the browser.

however it’s inconvenient during development not being able to see the error. this can be turned on with this code:

PHP:

ini_set("display_errors"1); 
error_reporting(E_ALL && ~E_NOTICE && E_WARNING);

this code should be removed / commented when put in production.

Tags: error, php

No feedback yet

Leave a comment


Your email address will not be revealed on this site.
PoorExcellent
note: all comments are moderated. do not spam and do not advertise. only comments relevant to the post will be published.
(Line breaks become <br />)
(For my next comment on this site)
(Allow users to contact me through a message form -- Your email will not be revealed!)