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

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

    Add the following in your index.php file. I first came across this when I moved my application from my XAMPP server to Apache 2.2 and PHP 5.4...

    I would advise you do it in your index.php file instead of the php.ini file.

    if( ! ini_get('date.timezone') )
    {
        date_default_timezone_set('GMT');
    }
    

提交回复
热议问题