I want to log all PHP errors into a log-file, but I don't want to display them to the user.
I use the following configuration in php.ini
track_errors=On
error_reporting = E_ALL
log_errors=On
display_errors = Off
error_log = php-error.log
date.timezone = Europe/Berlin
The problem I face right now:
I use an Ionic app. This request some php files on my server. When this php file contains some warnings, they are getting transferred too, and the Ionic app stops working, as it just expects a jsonp
response with a callback
, and doesn't allow any echoed statements or similar things. So I use error_reporting(0);
at the beginning of every file, but this shuts of errors completely again.
How can I completely turn off the errors from being transferred/displayed, and just write them to a file?