ecshop安装数据失败解决办法 Warning: date_default_timezone_get():

  1. 刚才安装Ecshop的时候,安装过程中出现了错误导致安装失败,后来自己研究了一下错误代码,发现居然不是自己的环境配置问题,是项目本身的不完善,哎...这里把解决方案分享给大家。

  2. 1.安装过程到了界面的时候,大家会看到屏幕顶部报出PHP错误,然后等你填好配置数据安装时,在安装数据时就会报错,然后安装过程停止;

  3. 1.png

  1. 2.大致错误如下:

    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 D:\wapm\www\ECShop\upload\install\includes\lib_installer.php on line 223 

     

     

    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 D:\wapm\www\ECShop\upload\install\includes\lib_installer.php on line 223 

  2. 3.错误提示是因为没有设置默认时区的原因,这时需要自己手动加一行代码到对应的文件中去,过程如下:Ecshop根目录--install--includes--;

  3. 2.png3.png4.png

     

  4. 4.打开lib_installer.php文件,将如下代码加入文件顶部,如图所示;

     

    date_default_timezone_set('Asia/Shanghai');

     

    时区的话,大家可以自己选择吧,我用的上海。


5.png6.png

 

版权声明:本文来源于互联网,如有侵权,请联系下方邮箱,一个工作日删除!