PDA

View Full Version : Set 2 values for error_reporting via .htaccess using php_value?


dome90uk
08-22-2009, 05:55 PM
Hi,

I am trying to set error_reporting to E_WARNING & ~E_NOTICE using the .htaccess file below - ( i am on shared hosting space ):

php_value max_execution_time 600
php_value output_buffering on
php_value error_reporting E_WARNING
php_value error_reporting E_NOTICE

<Files .htaccess>
order allow,deny
deny from all
</Files>

I can change it to E_WARNING or E_NOTICE but not set both
I have also tried to change it using this line in my .htacess file -

php_value error_reporting E_WARNING & ~E_NOTICE

Can someone tell me how to set the value of error reporting to two values please.

Any help appreciated thanks.

CFMaBiSmAd
08-22-2009, 06:01 PM
The php predefined constants E_WARNING, E_NOTICE... don't exist inside of a .htaccess file. You would need to use the corresponding numeric values.

dome90uk
08-22-2009, 06:25 PM
Thanks for your reply

I have found out the corresponding integers for the E_WARNIN & E_NOTICE below:

http://www.phpdig.net/ref/rn19re266.html

I am still a bit puzzled ! :confused:

It looks like the integers match up to individual settings ( i.e E_WARNING = a value of 2 ) but it still would not allow me to set two values.

The instructions I have is to configure error_reporting = E_WARNING & ~E_NOTICE

Does this mean i have to set error_reporting to E_WARNING & E_NOTICE?

If so how can i set both??

Again any help much appreciated

Inigoesdr
08-23-2009, 09:06 PM
To get the numerical value for those constants in YOUR environment you can simply echo them in a PHP file:
<?php
echo E_WARNING & ~E_NOTICE; // 2
?>
Then in your .htaccess file:
php_value error_reporting 2