Home  >  Article  >  Backend Development  >  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.解决方法

WBOY
WBOYOriginal
2016-08-08 09:25:261342browse

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


After installing php, use phpinfo(); to view the information, there is Warning: phpinfo (): It is not safe to rely on the system's timezone settings, because the system's timezone is not set.

Solution:

1. Open php.ini. If you don’t know the location of php.ini, you can use

<?php
phpinfo();
?>



to view the Loaded Configuration File to know the currently used php.ini location.

2. Find date.timezone, modify it to date.timezone = RPC, and save it.

[Date]

; Defines the default timezone used by the date functions

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

modified to

[Date]

; Defines the default timezone used by the date functions

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

date.timezone =

PRC

3. Restart php after modification and check phpinfo(); the warning disappears.

The above introduces the php Warning: phpinfo(): It is not safe to rely on the systems timezone settings. The solution includes the relevant content. I hope it will be helpful to friends who are interested in PHP tutorials.

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:Use of PHP EOF (heredoc)Next article:Use of PHP EOF (heredoc)