Page 1 of 1

Help finding the cause of errors outputting to browser

Posted: Mon Jul 11, 2011 1:58 pm
by edt123
Hi all,
I'm new to php, but experienced with programming and web development.
I inherited a script that I have got working, but it prints a screen full of warnings at the top of the page and I cant track down where to switch them off.
In the site ini file(included on every screen) there is a statement that sets reporting to E-Notice

According to my research, there should not be warnings visible, but there are.

Its a bit of a mess of includes and very little commenting and no documentation.
I managed to install nusphere and run the step through debugger, but it seems to be able to execute and output the page without stepping into the code that does this.
Very frustrating.
Does anyone have any ideas about how I might track down the cause of this behaviour?

Thanks iv advance

Re: Help finding the cause of errors outputting to browser

Posted: Mon Jul 11, 2011 2:13 pm
by AbraCadaver
The best thing is to fix the errors, but you can add:

Code: Select all

ini_set('display_errors', '1');

Re: Help finding the cause of errors outputting to browser

Posted: Mon Jul 11, 2011 3:16 pm
by oscardog
AbraCadaver wrote:The best thing is to fix the errors, but you can add:

Code: Select all

ini_set('display_errors', '1');
I think you meant...

Code: Select all

ini_set('display_errors', '0');
:wink:

Re: Help finding the cause of errors outputting to browser

Posted: Mon Jul 11, 2011 3:29 pm
by AbraCadaver
oscardog wrote:
AbraCadaver wrote:The best thing is to fix the errors, but you can add:

Code: Select all

ini_set('display_errors', '1');
I think you meant...

Code: Select all

ini_set('display_errors', '0');
:wink:
Doh! I was going to copy/paste/change, but only got to the first two... 8O

Re: Help finding the cause of errors outputting to browser

Posted: Tue Jul 12, 2011 5:07 am
by edt123
Much appreciated.
I'm generally of the belief that the errors should be understood and fixed, but given that this is just about outputting error messages I guess it should be enough to just switch it on and off as I need and forget the other stuff.
I am assuming that this ini_set() is equivalent to editing the ini file?
Will it then be impossible for another statement i and include in another include or something to reverse this?

I guess I don't just want to fix it, I want to learn more about php also.

Thanks again, it's good to be able to turn to someone with experience