centos下在php.ini设置时区
Posted yolo_bean
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了centos下在php.ini设置时区相关的知识,希望对你有一定的参考价值。
错误:
php Warning: Unknown: 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 in Unknown on line 0
解决方法:
find / -name php.ini 命令找到php.ini配置文件
找到date.timezone选项改为:date.timezone =PRC
service httpd restart 重启服务
(单页面的话可以设置date_default_timezone_set(‘PRC‘)
以上是关于centos下在php.ini设置时区的主要内容,如果未能解决你的问题,请参考以下文章