Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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

1 Answer 1

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

 
discard

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.