[SOLVED] Hide PHP Errors

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
Ree
Forum Regular
Posts: 592
Joined: Fri Jun 10, 2005 1:43 am
Location: LT

[SOLVED] Hide PHP Errors

Post by Ree »

is there a way to hide PHP errors in my scripts by setting this in my scripts instead of php.ini? i want errors not to be displayed even if error displaying is allowed in php.ini.

EDIT: it's error_reporting(0). no need to reply! :lol:
theda
Forum Contributor
Posts: 332
Joined: Sat Feb 19, 2005 8:35 am
Location: USA

Post by theda »

Also, you can put @ in front of functions to shut them up.
timvw
DevNet Master
Posts: 4897
Joined: Mon Jan 19, 2004 11:11 pm
Location: Leuven, Belgium

Post by timvw »

Code: Select all

ini_set('display_errors', FALSE);
This allows you to 'hide' them for your users, but to log them in a file...
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

just remember that hiding notices, warnings, and/or errors in these fashions doesn't make them go away (even turning error_reporting off/lower).. they still fire within php.
Post Reply