简体   繁体   English

PHP致命错误不在Error_Log中,如何启用?

[英]PHP Fatal Errors not in Error_Log, How to enable?

For some reason fatal errors do not appear in my server's error_log and I cannot seem to enable this level of logging. 由于某些原因, 致命错误不会出现在服务器的error_log中,并且我似乎无法启用此级别的日志记录。 Standard errors , php warnings and php notices however are all logged. 标准错误php警告php通知均已记录。

Logfile: /var/www/vhost/sitename/statistics/logs/error_log 日志文件: /var/www/vhost/sitename/statistics/logs/error_log

I have checked through my php.ini , httpd.conf and .htaccess and error reporting is set to E_ALL , but I must have missed something to enable fatal error logging. 我已经通过php.inihttpd.conf.htaccess进行了检查,并且错误报告设置为E_ALL ,但是我一定错过了一些启用致命错误记录的功能。

The php config is: 的PHP配置是:

display_errors  On  (Off)
display_startup_errors  On  (Off)
error_append_string no value    (no value)
error_log   no value    (no value)
error_prepend_string    no value    (no value)
error_reporting 2047
html_errors On  (Off)
ignore_repeated_errors  Off
log_errors  On  (On)
log_errors_max_len  1024
track_errors    Off
xmlrpc_error_number 0   (0)
xmlrpc_errors   Off

Does anyone know what could be wrong with the setup please? 有谁知道设置可能有什么问题吗? There must be a reason for this problem with php fatal errors? php致命错误一定有这个问题的原因?

I'm having the exact same problem for a few years now. 几年来,我遇到了完全相同的问题。

The only way I can even work around it is to temporarily enable display_errors ;-/ 我什至可以解决的唯一方法是临时启用display_errors;-/

Try to use 尝试使用

error_reporting(E_ALL);

in your script, or, if you want to suppress notices, use 在您的脚本中,或者,如果您想隐藏通知,请使用

error_reporting(E_ALL ^ E_NOTICE);

Try the next command 尝试下一个命令

php -i | grep error

It will show info about your php configuration and you can check if it is correct. 它会显示有关您的php配置的信息,您可以检查它是否正确。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM