Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Trying without succes to make apache display on screen errors on our development server. Basically I understand that my:

error_reporting  =  E_ERROR & E_RECOVERABLE_ERROR & E_STRICT

Has no effect over:

display_errors = On

As this will also insist in displaying all PHP notices as well. I was hoping that only the specified error level on the PHP ini would have effect over the display_errors directive but so far I have not managed to get it working.

Apache 2.2, PHP 5.3 on Ubuntu 9

share|improve this question

You're trying to filter specific types of notices, correct? The PHP manual shows a couple ways of doing this.

First, you can allow which errors to be reported by specifying the type followed by a pipe character (|) for each specified type. Second, if your intention is to remove a specified type you can use the caret character (^) (or NOT operator).

If you only want simple errors and warnings reported:

<?php display_errors(E_ERROR | E_WARNING); ?>

If you want to report all errors, but leave out error notices:

<?php display_errors(E_ALL ^ E_NOTICE); ?>

The only objective of display_errors is for visual purposes only and save you trips to the log file. All errors are logged regardless in a special log file.

share|improve this answer
Thanks but I have no issue with understanding the level reporting setup for PHP but I don't think that display_errors supports "levels" but just on/off in which case I get even INFO level. I'll try it. Thanks. – luison May 10 '11 at 22:19

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.