random1 Posted March 9, 2010 Share Posted March 9, 2010 Can you send all PHP errors that occurred during page execution to a MySQL 'error' table? If so how can I get/create an array of all page execution PHP errors (not display them) and then record them in the database? Quote Link to comment https://forums.phpfreaks.com/topic/194613-sending-all-php-errors-to-mysql-database/ Share on other sites More sharing options...
PFMaBiSmAd Posted March 9, 2010 Share Posted March 9, 2010 Just use php's built in error logging to do this for you - log_errors boolean Tells whether script error messages should be logged to the server's error log or error_log. Note: You're strongly advised to use error logging in place of error displaying on production web sites. error_log string Name of the file where script errors should be logged. You would set error_reporting to E_ALL, display_errors to OFF, log_errors to ON, and error_log to the file you want to use. If your web sit is functional, the file system will be operational and you will be able to write to a log file. The same is not true of a database. The database server might be experiencing problems, which is causing the errors you would like to see and trying to log the resulting errors to the database won't work. Quote Link to comment https://forums.phpfreaks.com/topic/194613-sending-all-php-errors-to-mysql-database/#findComment-1023540 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.