虚位以待(AD)
虚位以待(AD)
首页 > CMS教程 > Ecshop > ecshop安装出现date_default_timezone_get()问题

ecshop安装出现date_default_timezone_get()问题
类别:Ecshop   作者:码皇   来源:互联网   点击:

今天在安装ecshop时遇到警告如下: Warning: date_default_timezone_get(): It is not safe to rely on the system s timezone settings You are *required* to use the date timezone setting or the date_def ,魔客吧

今天在安装ecshop时遇到警告如下:

Warning: date_default_timezone_get(): 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 ...

很明显是由于PHP默认的时间区域设置问题导致的警告

date_default_timezone_get — 取得一个脚本中所有日期时间函数所使用的默认时区

默认时区,使用如下“假定”的顺序:

用 date_default_timezone_set() 函数设定的时区(如果设定了的话)

仅仅在 PHP 5.4.0 之前: TZ 环境变量(如果非空)

date.timezone 配置选项(如果设定了的话)

仅仅在 PHP 5.4.0 之前: 查询操作系统主机 (如果操作系统支持并允许)。

如果以上选择都不成功,date_default_timezone_get() 会则返回 UTC 的默认时区。

最简单的解决办法:

vim /etc/php.ini

找到date.timezone

将它的改为 date.timezone=utc 将前面的分号去掉,重启服务器

或者在index.php中加上 date_default_timezone_set('UTC');

相关热词搜索: ecshop安装出现date_default_timezone_get