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

前端 未结 24 2241
予麋鹿
予麋鹿 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:47

    This issue has been bugging me for SOME time as im trying to inject a "createbucket.php" script into composer and i keep being told my time-zone is incorrect.

    In the end the only thing that fixed the issue was to: $ sudo nano /etc/php.ini

    Search for timezone

    [Date]
    ; Defines the default timezone used by the date functions
    ; http://www.php.net/manual/en/datetime.configuration.php#ini.date.timezone
    date.timezone = UTC
    

    Ensure you remove the ;

    Then finally

    $ sudo service httpd restart
    

    And you'll be good to go :)

提交回复
热议问题