Reputation: 73
I want set up own error_log without some error types over htaccess.
Like this:
error_reporting = E_ALL & ~E_NOTICE & ~E_WARNING & ~E_DEPRECATED
error_reporting = E_ALL(32767) & ~E_NOTICE(8) & ~E_WARNING(2) & ~E_DEPRECATED(8192)
So it should be php_value error_reporting 24565
(32767-8-2-8192=24565)
But I still get PHP Warning. What I'm doing wrong?
Here is a full code:
php_flag display_startup_errors off
php_flag display_errors off
php_flag html_errors off
php_flag log_errors on
php_value error_log /path/log/error_log.log
php_value error_reporting 24565
Upvotes: 0
Views: 1065
Reputation: 2512
Although it is impossible to check the php code since it is not provided, here are a few things you can do.
error_reporting(E_ALL & ~E_NOTICE & ~E_WARNING & ~E_DEPRECATED);
var_dump(ini_get('error_reporting'));
trigger_error("Test", E_WARNING);
Run php test.php
.
The output should be: string(5) "24565"
, without any warning displayed.
Include this in your .htaccess file:
php_value error_reporting 24565
Now test if the value is accepted by PHP:
var_dump(ini_get('error_reporting'));
trigger_error("Test", E_WARNING);
Run with php test.php
.
It should output string(5) "24565"
, no warning displayed.
Look for the following functions:
ini_set('error_reporting', /* some value */);
error_reporting(/* some value */);
Upvotes: 2