Why are PHP errors printed twice?
Got it reproduced. The first error message is a result of the log_errors
setting and goes to STDERR
.
The second is a result of display_errors
and goes to STDOUT
.
Both settings can be altered during runtime. So in order to "ask PHP nicely", this suffices:
ini_set('log_errors', 1);
ini_set('display_errors', 0);