/    Sign up×
Community /Pin to ProfileBookmark

how to catch the errors and warnings of PHP to build a log file

Greetings

How can I “catch” the errors and warnings of PHP and MySQL when somethig goes wrong, so the user don’t see those messages on browser and I can create a log file with those message, or send email with the errors?

Thank ou very much

Sérgio

to post a comment
PHP

1 Comments(s)

Copy linkTweet thisAlerts:
@pyroJan 10.2004 — Depending on what you want to do, you can use the error suppressor (@) on a per-error basis, or you can set the error reporting level to [font=monospace]error_reporting(0);[/font]. (http://us2.php.net/manual/en/ref.errorfunc.php) As far as what to do with the errors, see http://us2.php.net/error_log
×

Success!

Help @sgalmeida spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.21,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...