安装时出现warning:date_default_timezone_get(): 什么原因?

2016-07-07 15:20 来源:www.chinab4c.com 作者: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 case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'UTC' for '8.0/no DST' instead in F:\yolin_www\ecshop\install\includes\lib_installer.php on line 223
这个如何解决,求帮忙解决

回答:
没人回答么?

data下有个config.php中有时区配置信息呢
可以使用服务器时间设置 utc 或者使用时区设置
$timezone = "Asia/Shanghai";

data/目录下没有config.php这个文件啊

我把提示的错误内容改成"Asia/Shanghai";

function get_local_timezone()
{
if (PHP_VERSION >= '5.1')
{
$local_timezone = "Asia/Shanghai";
}
结果安装的时候出现如下错误
安装数据............失败

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 case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'UTC' for '8.0/no DST' instead in F:\yolin_www\ecshop\includes\cls_mysql.php on line 163 Warning: date(): 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 'UTC' for '8.0/no DST' instead in F:\yolin_www\ecshop\includes\cls_mysql.php on line 165 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 case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'UTC' for '8.0/no DST' instead in F:\yolin_www\ecshop\includes\cls_mysql.php on line 173 OK

date_default_timezone_get(): It is not safe to rely on the system's timezone settings


没大碍的

今天装这个,试的办法基本上无外乎以下几种。
1, 修改PHP安装目录下的php.ini文件大约958行为以下.
[Date]
; Defines the default timezone used by the date functi**
; http://php.net/date.timezone
date.timezone = "UTC"

结果, 无效。

2. 修改/data/目录下config.php文件

$timezone = "UTC";

结果无效。

3,就是所谓在有date_default_timezone_get();前加设置时区的代码。
date_default_timezone_set('UTC');

结果: 无效。

-------------------------------------------------------------------------------------------
最后这个方法让我的解决了,这家伙不错。

王涛 http://wangtao.name/blog/2010/03/16/install_ecs2-7-1_error/

安装完成后,虽然有报错,不要理会。(你看数据库,确实表已经建立了)
在/data/目录下建一个文件install.txt 内容写上"ECSHOP INSTALLED"  扩展名改为.lock
最终就是install.lock
这时搞定。   大家看看行不行,我今天安装的版本是 V2.7.2

这个问题 哪有那么复杂哦。。
找到php.ini搜索 date.timezone 前面的 分号去掉。date.timezone = "Asia/Shanghai" 就OK了。

必须的是。。。修改完后 重启 apache我估计 楼上就是没重启apache



好用谢谢了