How do you turn error logging off for specific file in php?
I know that for not displaying the error you do
<?
error_reporting(0); // dont report/show errors
don't log errors; - // how to do that.
?>
How do you turn error logging off for specific file in php?
I know that for not displaying the error you do
<?
error_reporting(0); // dont report/show errors
don't log errors; - // how to do that.
?>
Error logging is controlled through the log_errors configuration setting, so you can turn it off with ini_set('log_errors', false) and then turn it on again at the end of the file (actually, saving the old value and reverting to that is better).
Note that this will only work for code that is executed once, not e.g. for code inside class methods.
error_reporting(0) effectively disables logging of the errors. If you want to log the errors, but don't display them, you should use
error_reporting(E_ALL); // or whatever level of reporting you need
ini_set('display_errors', 0);