Why can't this be a regular plugin? Or why can't I just override these settings in php.ini instead?
This code needs to go in mu-plugins
because of some quirks of how WP Core itself overrides the error logging settings.
- If you make changes in php.ini or other server level settings, they will get overridden by WP Core
- If you put
ini_set
anderror_reporting
changes in wp-config.php - same thing - they will load before the core files that modify error logging and get overridden.