php default error log path: C:\Windows\Temp\php-errors.log, often look at it, it can help you find many potential problems, maybe these problems do not affect normal operation.
Error description: PHP Warning: phpinfo(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'UTC' for '8.0/no DST' instead in C:\info.php on line 4
Solution:
Open the php.ini profile Found it [Date] ; Defines the default timezone used by the date functions ; http://php.net/date.timezone ; date.timezone =
Modified to: [Date] ; Defines the default timezone used by the date functions ; http://php.net/date.timezone date.timezone =PRC
Then remember to restart Apache!
In addition, there are two methods (not recommended)
1. Use date_default_timezone_set() to set date_default_timezone_set('PRC') in the header; East 8 time zone echo date('Y-m-d H:i:s');
2. Use ini_set ('date.timezone','Asia/Shanghai') in the header;
For China, optional values: Asia/Chongqing, Asia/Shanghai, Asia/Urumqi (Chongqing, Shanghai, Urumqi) Available in Hong Kong and Taiwan: Asia/Macao, Asia/Hong_Kong, Asia/Taipei (Macau, Hong Kong, Taipei), and Singapore: Asia/Singapore, as well as the old PRC. |