Home > Article > Backend Development > php run error
php running error?
Problem:
PHP running error message is as follows:
():Itisnotsafetorelyonthesystem'stimezonesettings.Youare*required*tousethedate.timezonesettingorthedate_default_timezone_set()function.Inc
Solution:
The following are three methods (any one will work):
1. Use date_default_timezone_set() on the header of the page to set date_default_timezone_set('PRC');
//East Eight Time Zone echo date('Y-m-d H:i:s');
2. Use ini_set('date.timezone','Asia/Shanghai');
3. Modify i in the header.
Open i and search for date.timezone. Remove the preceding semicolon and change it to: date.timezone =PRC
Restart the http service (such as apache2 or iis, etc.).
For more PHP related knowledge, please visit PHP Chinese website!
The above is the detailed content of php run error. For more information, please follow other related articles on the PHP Chinese website!