怎样设置PHP的timezone
- 浏览:1804
- |
- 更新:
- |
- 标签:php
如果在服务器中不设置timezone,总是会报warning, 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。所以需要配置php.ini
方法/步骤
访问phpinfo,找到php.ini的配置路径
Loaded Configuration File: /etc/php.ini
编辑 /etc/php.ini
搜索到 timezone,然后更改成为
date.timezone = Asia/Shanghai
保存
重启apache服务器,访问phpinfo,就会发现warning消失了
END- 相关内容非法爬取自百度经验
经验内容仅供参考,如果您需解决具体问题(尤其法律、医学等领域),建议您详细咨询相关领域专业人士。
展开阅读全部