首頁  >  文章  >  後端開發  >  php警告:phpinfo():依賴系統時區設定是不安全的。

php警告:phpinfo():依賴系統時區設定是不安全的。

WBOY
WBOY原創
2016-08-08 09:25:261343瀏覽

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


:安裝後,使用php 請​​(): It is not safe to rely on the system's timezone settings,原因是沒有設定係統的timezone。 解決方法:

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

<?php
phpinfo();
?>
php.ini

位置了。

2.找到date.timezone,修改為 date.timezone = RPC,後儲存。

[Date]

; Defines the default timezone used by the date ftions; Defines the default timezone used by the date functions; Defines the default timezone used by the date functions

; Defines the default s.

date.timezone = 

修改為

[Date]

; 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教程有興趣的朋友有所幫助。

陳述:
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn