加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 站长学院 > PHP教程 > 正文

php – Stop Warning:date()[function.date]:从本地主机

发布时间:2020-12-13 14:01:49 所属栏目:PHP教程 来源:网络整理
导读:Warning: date() [function.date]: 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 st

Warning: date() [function.date]: 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 …………

有许多Web应用程序弹出这个特定的错误.我可以设置

date_default_timezone_set('America/Los_Angeles');

但这不是我正在寻找的解决方案.

我可以从系统级别做一些事情.它只发生在LOCALHOST而不是实际的生产服务器上.

php.ini中的默认设置是date.timezone = America / Los_Angeles

[更新]编辑php.ini

Warning: phpinfo() [function.phpinfo]: 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

在一个服务器而不是另一个服务器上发生的原因是php.ini设置 date.timezone=.

你仍然需要选择一个实际的价值.你确实没有一个.或者错误的php.ini版本(有一个用于CLI,一个用于mod_php).

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读