PHP CLI won't log errors

前端 未结 6 1148
情书的邮戳
情书的邮戳 2020-12-13 06:23

PHP currently will not log errors produced from the command line.

I have :

log_errors = On
error_log = /var/log/php_errors.log

in

6条回答
  •  Happy的楠姐
    2020-12-13 06:36

    The logging/reporting behaviour of PHP is dependant on error_reporting too.

    Some PHP frameworks (for example CodeIgniter) execute an error_reporting(E_STRICT) statement or equivalent, when in production mode, which will severely reduce the number/kind of logged errors.

    If you want to debug something, then you can just put the following statement right before your code:

    error_reporting(E_ALL);
    

提交回复
热议问题