It is necessary to write it to the database when an error occurs, maybe there is a library with which you can catch these errors?

    1 answer 1

    With the set_error_handler function set_error_handler you can set your handler and do whatever you want with errors.