I’m trying to disable display_errors in php.ini for all sites by default. Currently, it is turned off in php.ini:
# cat /etc/php/8.4/fpm/php.ini | grep display_error
; display_errors
display_errors = Off
; separately from display_errors. We strongly recommend you set this to 'off'
If I do a phpinfo(); on a website of mine, the local and global config for display_errors is set to 1.
Currently, this directive is neither declared in the vhosts or fpm-pool-Configs. The only way to disable display_errors is to create a local .user.ini on every vHost, which is a little bit annoying. Is there a way to disable display_errors on the whole system?
# grep -ri display_errors /etc/php/8.4/fpm/
/etc/php/8.4/fpm/php.ini:; display_errors
/etc/php/8.4/fpm/php.ini:display_errors = Off
/etc/php/8.4/fpm/php.ini:; separately from display_errors. We strongly recommend you set this to 'off'
The find command doesn’t give any results besides my test .user.ini mentioned in this post. I’ve removed this .user.ini, removed the semicolon in the php.ini and restarted php-fpm. display_errors is “on” again.