|
-
Apr 21st, 2004, 01:47 PM
#1
Thread Starter
Frenzied Member
Global error mailing?
Is there any way to include a file into all of my files that will email me any errors that are produced? Instead of doing error checking and adding an "or die" statement with the mail() function... can I catch any error that is thrown? Maybe through php.ini?
-
Apr 21st, 2004, 04:30 PM
#2
You could set the auto_prepend_file directive in your php.ini which will define an error handler for all errors thrown during script execution. The errror handler will pick up the errors, collect them together in a variable and mail them off to you if neccessary at the end of the script.
Here's some info on the functions/methods I'd use:
http://uk.php.net/manual/en/function...or-handler.php - error handling to collect together a list of errors
http://uk.php.net/manual/en/function...n-function.php - shutdown function to mail the error list
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|