Click to See Complete Forum and Search --> : Global error mailing?
ober0330
Apr 21st, 2004, 01:47 PM
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?
visualAd
Apr 21st, 2004, 04:30 PM
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.set-error-handler.php - error handling to collect together a list of errors
http://uk.php.net/manual/en/function.register-shutdown-function.php - shutdown function to mail the error list
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.