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

WBOY
Release: 2016-08-08 09:25:26
Original
1363 people have browsed it

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();
?>
Copy after login



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.

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!