在 Windows Server 和美国/洛杉矶运行 PHP 5.4.14 在 php.ini 中设置了 date.timezone,但错误会使用 UTC 时间打印到日志中。有没有办法让日志显示当前当地时间。
如果在 php.ini 中设置了这些选项,PHP 将记录错误和警告。
error_reporting = E_ALL
log_errors = On
error_log = C:\some folder\php_errors.log
此选项(在同一文件中)将应用洛杉矶时间而不是 UTC 到每个记录条目的时间戳。
[Date]
; Defines the default timezone used by the date functions
; http://php.net/date.timezone
date.timezone = "America/Los_Angeles"