PHP Warning: PHP Startup: It is not safe to rely on
the system’s timezone settings. You are *required* to use the
date.timezone setting or the date_default_timezone_set() function. In
case you used any of those methods and you are still getting this
warning, you most likely misspelled the timezone identifier. We selected
‘***/***’ for ‘CST/8.0/no DST’ instead in Unknown on line 0
date() [function.date]: It is not safe to rely on the system’s
timezone settings. Please use the date.timezone setting, the TZ
environment variable or the date_default_timezone_set() function. In
case you used any of those methods and you are still getting this
warning, you most likely misspelled the timezone identifier. We
selected ‘***/***’ for ‘PST/-8.0/no DST’ instead
|
在 PHP 日志中或使用 data函数时,可能出现类似以上内容的错误。可以通过2个办法解决:
1、在程序的开头设置默认时间区。
date_default_timezone_set(”Asia/Shanghai”);
|
2、修改 php.ini 文件,Data 章节中的 date.timezone 选项。
[Date] ; Defines the default timezone used by the date functions ; date.timezone = Asia/Shanghai
|
以上 timezone 时间区的值可以在中找到。
阅读(1385) | 评论(0) | 转发(0) |