title: Turn off error reporting in PHP (Master vs local value)
body: <p>I have tried turning off error reporting in my code using </p>
  
  <pre><code>error_reporting(0);
  @ini_set('display_errors', 0);
  </code></pre>
  
  <p>and also by editing both the .htaccess files in both the root and frontend folders (separately).</p>
  
  <p>Editing the .htaccess to include code such as</p>
  
  <pre><code>php_flag display_startup_errors off
  php_flag display_errors off
  php_flag html_errors off
  php_flag log_errors on
  php_flag ignore_repeated_errors off
  php_flag ignore_repeated_source off
  php_flag report_memleaks on
  php_flag track_errors on
  php_value docref_root 0
  php_value docref_ext 0
  php_value error_log /home/path/logs/PHP_errors.log
  php_value error_reporting -1
  php_value log_errors_max_len 0
  </code></pre>
  
  <p>Produces a 500 error. Editing the .htaccess is otherwise allowed on this server,</p>
  
  <p>The description of the error is </p>
  
  <blockquote>
    <p>Invalid command 'php_flag', perhaps misspelled or defined by a module
    not included in the server configuration</p>
  </blockquote>
  
  <p>So it apparently doesn't like me adding this type of code in the .htaccess due to some underlying configuration.</p>
  
  <p>Looking at phpinfo() it says that the local value of error reporting is "off" (presumably caused by error_reporting(0)), but crucially the master value is "on".</p>
  
  <p>How might the master value be overwritten, or the local value actually win out? (errors are still reported when local value is "off")</p>