Search code examples
php.htaccess

How can I disable notices and warnings in PHP within the .htaccess file?


I just want to only turn on PHP errors and disable all notices and warnings in PHP files.


Solution

  • It is probably not the best thing to do. You need to at least check out your PHP error log for things going wrong ;)

    # PHP error handling for development servers
    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/public_html/domain/PHP_errors.log
    php_value error_reporting -1
    php_value log_errors_max_len 0