CentOS 6.5 [PHP Error] strftime(): It is not safe to rely on the system's timezone settings.
2018-01-23 20:23
696 查看
环境:CentOS 6.5 64bit
PHP版本:5.3.3
【问题】
在搭建stalker server时,/var/www/html/stalker_portal/deploy 执行phing出现如下错误:
[PHP Error] 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. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Asia/Chongqing'
for 'CST/8.0/no DST' instead [line 77 of /usr/share/pear/phing/tasks/system/TstampTask.php]
【解决方法】
1.第一种办法
在页面头部加入以下语句:
这种方法有个缺点,就是所有的页面都得添加。
2.第二种办法
在php.ini里找到date.timezone这行,把值改成PRC,如date.timezone
= PRC
如果没有这一行直接加上就好。最后重启WEB服务器与PHP即可。
PHP版本:5.3.3
【问题】
在搭建stalker server时,/var/www/html/stalker_portal/deploy 执行phing出现如下错误:
[PHP Error] 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. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Asia/Chongqing'
for 'CST/8.0/no DST' instead [line 77 of /usr/share/pear/phing/tasks/system/TstampTask.php]
【解决方法】
1.第一种办法
在页面头部加入以下语句:
date_default_timezone_set("PRC");
这种方法有个缺点,就是所有的页面都得添加。
2.第二种办法
在php.ini里找到date.timezone这行,把值改成PRC,如date.timezone
= PRC
如果没有这一行直接加上就好。最后重启WEB服务器与PHP即可。
相关文章推荐
- Warning: strftime(): It is not safe to rely on the system's timezone settings.
- Warning: strftime() [function.strftime]: It is not safe to rely on the system's timezone settings.
- PHP Warning: phpinfo(): It is not safe to rely on the system's timezone settings.处理方法
- 关于php中Warning: date(): It is not safe to rely on the system's timezone settings.解决
- date(): It is not safe to rely on the system’s timezone settings
- date(): It is not safe to rely on the system's timezone settings in CodeIgniter
- 解决PHP date调用警告:It is not safe to rely on the system's timezone settings 转载
- Cacti编译安装错误: Warning: strtotime(): It is not safe to rely on the system's timezone settings.
- Warning: date(): It is not safe to rely on the system's timezone settings. You are *required* to use
- 解决PHP date调用警告:It is not safe to rely on the system's timezone settings
- It is not safe to rely on the system's timezone settings. 的PHP问题处理
- date(): It is not safe to rely on the system’s timezone settings.
- home 解决php的“It is not safe to rely on the system’s timezone settings”问题
- 微信第三方开发程序中上传头像图片提示It is not safe to rely on the system's timezone settings
- Warning: date(): It is not safe to rely on the system's timezone settings. You are *required* to us
- Warning: date(): It is not safe to rely on the system's timezone settings
- date(): It is not safe to rely on the system’s timezone settings.
- PHP Warning: date(): It is not safe to rely on the system’s timezone settings
- PHP Warning: strtotime(): It is not safe to rely on the system's timezone settings.
- PHP Warning: phpinfo(): It is not safe to rely on the system's timezone settings