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

Can someone please provide a list of the numbers we need to use to configure php error reporting levels in an Apache vhost? I think they're called "bitmask"s or something, but I cant find a list of them anywhere.

ie in Apache:

php_value error_reporting x

What should x be if I want the equivalent of:

error_reporting(E_ERROR);

And since there's no reference on this anywhere online (that I can find), let's do the rest too!

E_ALL = x

E_NOTICE = y

E_WARNING = z

share|improve this question

1 Answer 1

up vote 3 down vote accepted

Is this what you're looking for ?

EDIT

The values listed in the table pointed to above are the ones that you want. You will note that with the exception of E_ALL they are all powers of 2. Each of the values corresponds to a bit position in an integer. Adding the values of these bit positions together gives the value that you want in your vhost definition e.g.

if you want error reporting for E_ERROR E_NOTICE and E_USER_WARNING

Constant            Value         Binary

E_ERROR               1                1
E_NOTICE              8             1000
E_USER_WARNING      512       1000000000

Total               521       1000001001                                 

So the value to use in your vhost php_value error_reporting directive would be 521.

share|improve this answer
    
+1 for going straight to the source. –  danlefree Oct 10 '10 at 7:41
    
No, those pre-defined constants only work in PHP, and the page doesn't explain how to combine them to get the value you want. It says the bitwise operators only work in PHP.ini, but I need a single numeric value for an Apache vhost. –  Nick Oct 22 '10 at 4:08
    
You combine them by adding them together to get the value that you want. Why the down vote ? –  Iain Oct 22 '10 at 7:37
    
Thanks for the clarification. I was trying to figure out how to get the integer value, and the PHP manual doesn't explain that very well. –  Nick Nov 28 '10 at 18:06

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.