开启error_reporting后,出现如下提示:
Warning: strftime(): 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
--- 原因是因为没有配置 timezone,解决方法:设置timezone
有2中方法可设置:
方法1:
通过date_default_timezone函数设置,如:
date_default_timezone("PRC"); // 设置为北京时间所在时区
方法2:
在php.ini文件中设置,设置date.timezone ="PRC"