0

As title describes.

My sites have been moved to a newer environment, and some non-crititcal errors has come up. I want to suppress all the warnings on the websites, but still want them to be logged to the standard error_log, so i can fix the errors without my sites looking non-functional.

Is there some easy way to do that?

3
  • Turn off display_errors in php.ini. Or in your code ini_set('display_errors', 0); Best to fix the errors though. Commented Mar 4, 2013 at 14:22
  • 1
    php.net/manual/en/… Technically, though, you should fix your code to eliminate the errors/warnings from occurring in the first place. Commented Mar 4, 2013 at 14:22
  • yes marc, and im going to, but i want to silence the errors from the websites while i fix them. Commented Mar 4, 2013 at 14:25

3 Answers 3

1
error_log = /var/log/php-scripts.log
display_errors = Off

Modify php.ini as shown above. And restart apache to load the new php.ini

Sign up to request clarification or add additional context in comments.

Comments

0

See here for the relevant php.ini settings. You will want to pay particular attention to display_errors, log_errors and error_log

Comments

0

In php.ini set (look for the existing entries and change them)

display_errors to "0"

to disable the output of errors and set

log_errors to "1"

to enable logging of errors.

You should be able to use ini_set() as well as .htaccess to set these values as they are both marked as INI_ALL if you don't have access to php.ini

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.