Вопрос

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?

Это было полезно?

Решение

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

Другие советы

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

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

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top