I’ve seen a lot of forums posts lately around AJAX errors coming from PHP errors being thrown, which throw off the parsing of JSON responses coming back from the server. While it’s good to know when these errors are being thrown, at the same time there’s not much value in it breaking the execution of the application in the cases that the error may be of type E_NOTICE or E_STRICT.
Generally speaking, it’s best practice in production to not log errors to the screen. You can control this by adding this directive to the php.ini file…
display_errors = stderr
Now the big question is where do these errors all go to? PHP gives a few options here with the error_log directive, where you state the file you want the errors written to…
log_errors = On error_log = /path/to/log/file
But the more preferred method is to have the errors written to the system error log, which on Windows is the event log and Unix systems syslog(3).
log_errors = On error_log = syslog
Doing this enables you to still track errors while not disturbing your users.