[Mon Mar 23 02:31:33.059828 2015] [:error] [pid 3372:tid 139994861631232] [client 172.16.10.180:58471] PHP Notice: date_default_timezone_set(): Timezone ID '' is invalid in /export/htdocs/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/LoadConfiguration.php on line 41
[Mon Mar 23 02:31:35.617828 2015] [:error] [pid 3372:tid 139994861631232] [client 172.16.10.180:58471] PHP Fatal error: Uncaught exception 'ErrorException' with message 'date_default_timezone_get(): 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 the timezone 'UTC' for now, but please set date.timezone to select your timezone.' in /export/htdocs/vendor/monolog/monolog/src/Monolog/Logger.php:248\nStack trace:\n#0 [internal function]: Illuminate\\Foundation\\Bootstrap\\HandleExceptions->handleError(2, 'date_default_ti...', '/export/gw.molp...', 248, Array)\n#1 /export/htdocs/vendor/monolog/monolog/src/Monolog/Logger.php(248): date_default_timezone_get()\n#2 /export/htdocs/vendor/monolog/monolog/src/Monolog/Logger.php(543): Monolog\\Logger->addRecord(400, 'exception 'Erro...', Array)\n#3 /export/htdocs/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/Han in /export/htdocs/vendor/monolog/monolog/src/Monolog/Logger.php on line 248
[Mon Mar 23 02:31:36.783063 2015] [:error] [pid 3372:tid 139994861631232] [client 172.16.10.180:58471] PHP Fatal error: Uncaught exception 'ErrorException' with message 'date_default_timezone_get(): 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 the timezone 'UTC' for now, but please set date.timezone to select your timezone.' in /export/htdocs/vendor/monolog/monolog/src/Monolog/Logger.php:248\nStack trace:\n#0 [internal function]: Illuminate\\Foundation\\Bootstrap\\HandleExceptions->handleError(2, 'date_default_ti...', '/export/gw.molp...', 248, Array)\n#1 /export/htdocs/vendor/monolog/monolog/src/Monolog/Logger.php(248): date_default_timezone_get()\n#2 /export/htdocs/vendor/monolog/monolog/src/Monolog/Logger.php(543): Monolog\\Logger->addRecord(400, 'exception 'Symf...', Array)\n#3 /export/htdocs/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/Han in /export/htdocs/vendor/monolog/monolog/src/Monolog/Logger.php on line 248
@taylorotwell i am getting this error, please rectify.
config/app.php:
'timezone' => 'UTC',
'timezone' => env('APP_TIMEZONE'),
@overtrue i did set in config/app.php and .env file APP_TIMEZONE=Asia/Kuala_Lumpur
dd(env('APP_TIMEZONE')) ?
@overtrue it shows Asia/Kuala_Lumpur, the error is only happen when there is a huge spike on traffic.
try add a default value:
'timezone' => env('APP_TIMEZONE', 'Asia/Kuala_Lumpur'),
This is often seen when you have subdir(s) with the same file names under config dir, since Laravel 5 dropped cascading support. I thought this has been fixed since 5.0.3 though.
@overtrue it works fine, but without the default value will prompt error if there is huge spike of traffic.
@phanan: there is no same file names under config dir.
Hmm... Try logging config('app') under huge spike of traffic and see what's there, then? If it's empty, maybe your app has some problem loading the config files under such circumtances.
Probably need more detail, version used, opcache (could cause issue) or even might be related to #7354
@crynobone Yes, this is related to #7354 due to PHP thread-safe i guess.
There isn't any workable solution right now, #7425 was merged but later reverted due to regression bug https://github.com/laravel/framework/commit/866a8cfc58430830069bd24feacf2d81e99385a2#commitcomment-9767647
Please check your php.ini date.timezone directive
I'm getting this on a windows machine:
date_default_timezone_set(): Timezone ID 'Enter the new date: (mm-dd-yy)' is invalid
config/app.php = 'timezone' => 'UTC',
date_default_timezone_set('UTC')
How do we know which one of the 20 suggested answers is the correct one???
By using function timezone_identifiers_list(); will confirm the timezone supported in php use this if(!in_array('your timezone', $zoneList)) { set default timezone here }
Most helpful comment
How do we know which one of the 20 suggested answers is the correct one???