If your php.ini does not have safe_mode
or open_basedir
in effect, you can do this
ini_set('error_log', '/dev/null');
You can also use .htaccess at your docroot and add
php_value error_log /dev/null
Domanda
How can I prevent php error logging in php? I can print errors, but I can't disable error logging(all php errors are appended to error_log
in my host). I have tried to search the net, but I haven't find anything(exept solutions which are not working for me).
My function that shows errors:
function show_errors($log = false) {
if ($log) {
// so what here?
}
error_reporting(E_ALL);
ini_set('display_errors', '1');
}
But remember. I can't use php_flag
s or php_value
s in my .htaccess file because my web server has blocked them.
Soluzione
If your php.ini does not have safe_mode
or open_basedir
in effect, you can do this
ini_set('error_log', '/dev/null');
You can also use .htaccess at your docroot and add
php_value error_log /dev/null