“date(): It is not safe to rely on the system's timezone settings…”

前端 未结 24 2267
予麋鹿
予麋鹿 2020-11-22 11:06

I got this error when I requested to update the PHP version from 5.2.17 to PHP 5.3.21 on the server.

24条回答
  •  日久生厌
    2020-11-22 11:52

    You probably need to put the timezone in a configuration line in your php.ini file. You should have a block like this in your php.ini file:

    [Date]
    ; Defines the default timezone used by the date functions
    ; http://php.net/date.timezone
    date.timezone = America/New_York
    

    If not, add it (replacing the timezone by yours). After configuring, make sure to restart httpd (service httpd restart).

    Here is the list of supported timezones.

提交回复
热议问题