Home >Backend Development >PHP Tutorial >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 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(); ?>
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 =
PRC3. 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.