Change php error reporting to hide warnings for specific site only [Debian|Ubuntu]

If you have access to the apache vhost configurations, of course you can also use php_flag directives inside a Virtual Host in the sites-available directory. This way, they're only applied to this vhost.

Add something like this inside your Virtual Host:

<IfModule mod_php5.c>
    php_admin_flag display_errors off


If you want only actual errors displayed, you can use the php directive error_reporting with an integer value that describes the types of error levels you want to be displayed:

<IfModule mod_php5.c>
    php_admin_flag display_errors on
    php_admin_value error_reporting 22517

This is equivalent to a setting of

error_reporting = E_ALL & ~E_NOTICE & ~E_WARNING & ~E_STRICT & ~E_DEPRECATED;

in php.ini. More possible values for example here:

Error reporting value calculator: