Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

alexleonard's avatar

[L5] date_default_timezone error on clear-compiled

This morning following a composer update I received the following error:

PHP Notice:  date_default_timezone_set(): Timezone ID '' is invalid in /path/to/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/LoadConfiguration.php on line 41
PHP Stack trace:
PHP   1. {main}() /path/to/artisan:0
PHP   2. Illuminate\Foundation\Console\Kernel->handle() /path/to/artisan:34
PHP   3. Illuminate\Foundation\Console\Kernel->bootstrap() /path/to/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php:88
PHP   4. Illuminate\Foundation\Application->bootstrapWith() /path/to/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php:174
PHP   5. Illuminate\Foundation\Bootstrap\LoadConfiguration->bootstrap() /path/to/vendor/laravel/framework/src/Illuminate/Foundation/Application.php:141
PHP   6. date_default_timezone_set() /path/to/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/LoadConfiguration.php:41
PHP Fatal error:  Call to undefined method Illuminate\Foundation\Bootstrap\ConfigureLogging::configureHandler() in /path/to/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/ConfigureLogging.php on line 55
PHP Stack trace:
PHP   1. {main}() /path/to/artisan:0
PHP   2. Illuminate\Foundation\Console\Kernel->handle() /path/to/artisan:34
PHP   3. Illuminate\Foundation\Console\Kernel->bootstrap() /path/to/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php:88
PHP   4. Illuminate\Foundation\Application->bootstrapWith() /path/to/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php:174
PHP   5. Illuminate\Foundation\Bootstrap\ConfigureLogging->bootstrap() /path/to/vendor/laravel/framework/src/Illuminate/Foundation/Application.php:141
PHP   6. Illuminate\Foundation\Bootstrap\ConfigureLogging->configureHandlers() /path/to/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/ConfigureLogging.php:18

Anyone else seeing this?

0 likes
39 replies
alexleonard's avatar

That's weird. LoadConfiguration doesn't appear to be loading the config. Line 41 is:

date_default_timezone_set($config['app.timezone']);

If I temporarily hack that and hardcode a timezone then a new error is thrown

PHP Fatal error: Call to undefined method Illuminate\Foundation\Bootstrap\ConfigureLogging::configureHandler() in /path/to/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/ConfigureLogging.php on line 55

Something is messed up somewhere..

kushpal's avatar

i also got the same issue after composer update, todAY.. :-( is there any problem with current changes in l5?

alexleonard's avatar

I renamed my local config folder but no change. Can't see how that would impact it given that I'm running on local.

I'm checking through framework changes now to see whether there's anything funny there.

alexleonard's avatar

11 framework commits since my last composer update.. !

kushpal's avatar

I simply removed the local folder and find no change

Cocoon's avatar

Hmm, had the same problems, but I followed the latest commits and now it is working again. Not sure what was causing the problem, but deleting the 'local/app.php' was one of the changes.

alexleonard's avatar

Hmm, I can't see anything I might have missed on laravel/laravel updates (or how removing config/local/ would assist anything - surely only the keys that override should be being called).

I'm going to install a fresh copy and see what's going on there.

kushpal's avatar

@cocoon which package of laravel 5.0 u are using as i am using "laravel/framework": "~5.0"

Cocoon's avatar

It's the same for me: "~5.0".

Sorry, I also didn't understand what the issue was, but I can only report that following the latest 5 commits from https://github.com/laravel/laravel/commits/develop solved the issue for me.

I still have the same problem as reported here: https://laracasts.com/discuss/channels/general-discussion/l5-latest-commit-breaks-if-using-waygenerators-or-image-internvention

So I removed the packages and will wait for it to be fixed.

promaxdigital's avatar

Hello , I have same problem arrived. What is solution of this problem. I am using Laravel 5.0.

alexleonard's avatar

I did a fresh 5.0 install, renamed my main project's config folder to configxxx and pasted the config folder from the fresh install in and that error has gone away.

So I must have missed something in laravel/laravel commits.

I'm going to start rebuilding my config settings from scratch and see how I get on.

alexleonard's avatar

Yep, as soon as I put a local/app.php back into config it breaks. It's as though it's no longer cascading to get config/local/app.php undefined keys from config/app.php

alexleonard's avatar

Strangely with my .env -> APP_ENV=local

If I add /config/staging/app.php (which only has the url key configured) that also breaks artisan optimize with the PHP Notice: date_default_timezone_set(): Timezone ID '' is invalid error

xirkus's avatar

Exactly the same here too. Tried removing way/generators as per an earlier comment but no difference.

winternight's avatar

What's actually happening here is the local config completely overwrites the default config (config/app.php). For now, put everything from config/app.php into config/local/app.php and make the necessary changes until it's fixed.

1 like
xirkus's avatar

I've done that. No real improvement. composer update still shows an error and all may pages are outputting my cert!!! i.e. -----BEGIN CERTIFICATE-----

bestmomo's avatar

I've just updated a L5 project, following the last commits and it seems to work fine.

xirkus's avatar

A temporary solution is to just go back to "laravel/framework": "dev-master#846c935194a036901ba6b4397c8897fa51e19111",

Thanks @winternight for the idea. Get's me back developing at least.

4 likes
J5Dev's avatar

Im having the exact same problem, but only when trying to use a local config, it seems to be overwriting the full config, as opposed to only overwriting the settings that are added.

1 like
J5Dev's avatar

@winternight Yup, saw it after id posted (always the case!), thanks. Looks like thats all we can do.

1 like
sdsheeks's avatar

Setting to the below in composer.json worked and I just tried it this morning by removing it, but the breaking change is still present.

"laravel/framework": "dev-master#846c935194a036901ba6b4397c8897fa51e19111"

amcsi's avatar

Specifying dev-master#846c935194a036901ba6b4397c8897fa51e19111 causes a different problem for me: a white screen of death.

Morgon's avatar

https://github.com/laravel/framework/issues/6593#issuecomment-65948860 "Cascading configs are no longer supported in L5, see recent commits where the config code has seen a complete rewrite."

Not sure how I feel about this, since I do rely on local configs... but as always, "This stuff is still subject to change."

In this commit, Taylor says that overrides are unnecessary due to .env files, but how would you change something like app.url via .env?

pmall's avatar

Another thing : dot notations no longer work with config.

For example I had :

# /resources/config/myapp.php

<?php

return [
  'videos.path' => '...',
]

config('myapp.videos.path') didn't work. However :

# /resources/config/myapp.php

<?php

return [
  'videos' => ['path' => '...'],
]

config('myapp.videos.path') works.

Next

Please or to participate in this conversation.