Skip to content
Advertisement

PHP error_log errors to MySQL

In a previous ticket i asked about logging PHP errors in MySQL which gives me:

JavaScript

I can make this work but only if it is triggerred like this:

JavaScript

However, I also want the error handler to be called for all errors such as syntax errors like:

JavaScript

But these errors are just outputted to the screen, what am i doing wrong?

Advertisement

Answer

You can only handle runtime errors with a custom error handler. The echo "foo error in your example happens when parsing (i.e. reading in) the source. Since PHP can not fully parse the code, it can also not run your error handler on this error.

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement