1

I want to turn off all the php errors from .htaccess file. I tried with following stackoverflow question.

Enabling error display in php via htaccess only

.htaccess file:

php_flag display_startup_errors off
php_flag display_errors off
php_flag html_errors off
php_flag  log_errors on
php_value error_log  /home/petstail/public_html/PHP_errors.log

And in my httpd.conf file, in virtualhost I put directory like,

<Directory "/home/website/public_html">
    Options All MultiViews
    AllowOverride All
    Order allow,deny
    Allow from all
</Directory>

ERROR LOG:

Invalid command 'php_flag', perhaps misspelled or defined by a module not
included in the server configuration

But, still I am getting internal server error (500). What should I do? What configurations am I missing?

Thanks.

Community
  • 1
  • 1
Ronak Patel
  • 5,083
  • 7
  • 44
  • 122

1 Answers1

1

"defined by a module not included in the server configuration" is most probably the reason. It tells you, that it is not allowed to set php_flag inside the .htaccess file. You need to to set those value in the vHost configuration – or even better in the php.ini.

feeela
  • 26,359
  • 6
  • 56
  • 68
  • How can I do it? can you elaborate your answer please.. I don't know much about server configurations.. – Ronak Patel Feb 18 '14 at 21:34
  • In that case you are maybe better with [using `error_reporting( 0 )` in your application](http://php.net/manual/en/function.error-reporting.php)… I just don't want to post a whole tutorial on Apache configuration here – there are a lot of those out on the web. – feeela Feb 18 '14 at 21:38