Il 26/04/22 15:29, fmigliori ha scritto:
> Perché l'errore fatale interrompe lo script.
Embè?
Comunque ecco qualche altro esperimento.
$ php -i | grep log_errors
log_errors => On => On
$ php -i | grep error_log
error_log => /var/log/error.log => /var/log/error.log
$ php -i | grep display_errors
display_errors => Off => Off
$ php -r "trigger_error('');"
$ tail -n1 /var/log/error.log
[27-Apr-2022 17:40:34 Europe/Berlin] PHP Notice: in Command line code
on line 1
Lo stacktrace non c'è.
C'è da dire che però, dopo aver fatto qualche modifica a php.ini, lo
stack trace appare, ma sullo schermo (non in /var/log/error.log).
$ php -i | grep log_errors
log_errors => Off => Off
$ php -i | grep error_log
error_log => no value => no value
$ php -i | grep display_errors
display_errors => STDOUT => STDOUT
$ php -r "trigger_error('');"
Notice: in Command line code on line 1
Call Stack:
0.0000 392704 1. {main}() Command line code:0
0.0000 392704 2. trigger_error() Command line code:1
$ tail -n1 /var/log/error.log
[27-Apr-2022 17:40:34 Europe/Berlin] PHP Notice: in Command line code
on line 1
Non si può fare niente per includere lo stacktrace in /var/log/error.log?