dtiopy6088 2011-05-10 14:05
浏览 109
已采纳

PHP错误“依赖系统的时区设置是不安全的。”使用$ _GET时

I'm getting the error that many have seen when upgrading from PHP 5.2.9 to PHP 5.3.0, but oddly, the error is showing up as the result of a reference to a $_GET variable, not anything to do with a timezone setting.

Here's the error:

Warning: date_default_timezone_get(): 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.

Has anyone else seen this same thing, and found a way to resolve it without simply changing the error_reporting level?

Thanks.

  • 写回答

2条回答 默认 最新

  • duanqie5741 2011-05-10 14:11
    关注

    I also had that error, when I upgraded from PHP 5.2 to PHP 5.3. I solved that by setting the corresponding server timezone in my php.ini:

    date.timezone = "Europe/Berlin"
    

    Following http://php.net/manual/de/function.date-default-timezone-set.php, since PHP 5.3 a E_WARNING is thrown if the timezone was not set.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥50 用易语言http 访问不了网页
  • ¥50 safari浏览器fetch提交数据后数据丢失问题
  • ¥15 matlab不知道怎么改,求解答!!
  • ¥15 永磁直线电机的电流环pi调不出来
  • ¥15 用stata实现聚类的代码
  • ¥15 请问paddlehub能支持移动端开发吗?在Android studio上该如何部署?
  • ¥20 docker里部署springboot项目,访问不到扬声器
  • ¥15 netty整合springboot之后自动重连失效
  • ¥15 悬赏!微信开发者工具报错,求帮改
  • ¥20 wireshark抓不到vlan