PHP CLI won't log errors

前端 未结 6 1147
情书的邮戳
情书的邮戳 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条回答
  •  温柔的废话
    2020-12-13 06:38

    as a diagnostic you can attempt to force a write to the error log this way.

    php -c /etc/php5/cli/php.ini -r " error_log('test 123'); "
    

    you should now see test 123 in your log

    tail /var/log/php_errors.log
    

提交回复
热议问题