php Warning: phpinfo(): It is not safe to rely on the systems timezone settings.解决方法

  • A+
所属分类:php教程
摘要

:本篇文章主要介绍了php Warning: phpinfo(): It is not safe to rely on the systems timezone settings.解决方法,对于PHP教程有兴趣的同学可以参考一下。

php Warning: phpinfo(): It is not safe to rely on the system's timezone settings.解决方法

php Warning: phpinfo(): It is not safe to rely on the systems timezone settings.解决方法

安装php后,使用phpinfo();查看信息,有Warning: phpinfo(): It is not safe to rely on the system's timezone settings,原因是没有设定系统的timezone。

解决方法:

1.打开php.ini,如不知道php.ini的位置,可以使用

 

php Warning: phpinfo(): It is not safe to rely on the systems timezone settings.解决方法


查看Loaded Configuration File就知道当前使用的php.ini位置了。

2.找到date.timezone,修改为 date.timezone = RPC,后保存。

[Date]

; Defines the default timezone used by the date functions

; http://php.net/date.timezone

date.timezone =

修改为

[Date]

; Defines the default timezone used by the date functions

; http://php.net/date.timezone

date.timezone = PRC

3.修改后重启php,查看phpinfo(); warning 消失。

php Warning: phpinfo(): It is not safe to rely on the systems timezone settings.解决方法

以上就介绍了php Warning: phpinfo(): It is not safe to rely on the systems timezone settings.解决方法,包括了方面的内容,希望对PHP教程有兴趣的朋友有所帮助。

除非注明,否则均为@蒲公英网原创文章,转载必须以链接形式标明本文链接

本文链接:https://www.aipgy.com/169267.html

avatar

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: