简体   繁体   中英

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. Standard errors , php warnings and php notices however are all logged.

Logfile: /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.

The php config is:

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?

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 ;-/

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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