Page 1 of 1

Display Errors Off -> set_error_handler()

Posted: Sat Feb 18, 2006 1:44 pm
by seodevhead
If in php.ini, Display_Errors is set to 'OFF' and you use the set_error_handler() function in your script and supply a error handling function... do the errors display? Ideally I would like to have display_errors turned off always and override it with a switch using set_error_handler('myerrorfunction');. Thanks for your help.

Posted: Sat Feb 18, 2006 2:10 pm
by John Cartwright
heres the order you should try things

1) Try it yourself
2) Google
3) Post here

Have you tried #1?

Posted: Sat Feb 18, 2006 2:24 pm
by seodevhead
1) I have the error handling function with set_error_handler() implemented, but I do not have display_errors set to OFF yet. Because I do not know how to access php.ini, I thought I would find out if I even can do this at all before opening up another can of worms.

2) I did a couple searches and did not find an answer.

3) I can't believe you want to "filter" questions -- like this one, which is most obviously valid and on-topic. Hopefully someone can lend me a helping hand on this legitimate question as a fellow developer. :)

Posted: Sat Feb 18, 2006 2:30 pm
by John Cartwright
We filter out questions the questions that should have be atleast attempted in the first place. Not to sound unhelpful, but it is not our place here to promote users to ask first then try it for themselves later.. that simply isn't fair to us who donate our time when the user could have tried it himself.

To answer your question -- your custom error handler will still be executed.

Posted: Sat Feb 18, 2006 2:45 pm
by seodevhead
Hey Jcart... no problem at all.. I completely understand. I would hope that all posters take it upon themselves to put forth an attempt to solve their problems before handing them off to more experienced developers. But I would also hope that all posters, whether in the asking or answering categories, feel welcome to post as such. Thanks for the answer on the question. Looks like it will be best for me to just turn display_errors to OFF in the php.ini and use my error_handler() function for my scripts. Thanks again.

Posted: Sat Feb 18, 2006 5:33 pm
by Ambush Commander
You should learn about php.ini. Configuration issues are nasty bugs that are hard to track down.