Help finding the cause of errors outputting to browser

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
edt123
Forum Newbie
Posts: 2
Joined: Mon Jul 11, 2011 1:44 pm

Help finding the cause of errors outputting to browser

Post 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
User avatar
AbraCadaver
DevNet Master
Posts: 2572
Joined: Mon Feb 24, 2003 10:12 am
Location: The Republic of Texas
Contact:

Re: Help finding the cause of errors outputting to browser

Post by AbraCadaver »

The best thing is to fix the errors, but you can add:

Code: Select all

ini_set('display_errors', '1');
mysql_function(): WARNING: This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQLextension should be used. See also MySQL: choosing an API guide and related FAQ for more information.
oscardog
Forum Contributor
Posts: 245
Joined: Thu Oct 23, 2008 4:43 pm

Re: Help finding the cause of errors outputting to browser

Post 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:
User avatar
AbraCadaver
DevNet Master
Posts: 2572
Joined: Mon Feb 24, 2003 10:12 am
Location: The Republic of Texas
Contact:

Re: Help finding the cause of errors outputting to browser

Post 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
mysql_function(): WARNING: This extension is deprecated as of PHP 5.5.0, and will be removed in the future. Instead, the MySQLi or PDO_MySQLextension should be used. See also MySQL: choosing an API guide and related FAQ for more information.
edt123
Forum Newbie
Posts: 2
Joined: Mon Jul 11, 2011 1:44 pm

Re: Help finding the cause of errors outputting to browser

Post 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
Post Reply