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

Synatex's avatar

Updating from 5.5 to 5.6 resulting in "A facade root has not been set"

Hey guys!

After upgrading from 5.5 to 5.6 I am getting some curious errors I've never seen before.

"Fatal error: Uncaught RuntimeException: A facade root has not been set. in vendor\laravel\framework\src\Illuminate\Support\Facades\Facade.php:218"

I've tried removing all facades from my app config, however it doesnt seem to get until there. The full track:

Fatal error: Uncaught RuntimeException: A facade root has not been set. in \vendor\laravel\framework\src\Illuminate\Support\Facades\Facade.php:218 Stack trace: #0 \app\Exceptions\Handler.php(47): Illuminate\Support\Facades\Facade::__callStatic('environment', Array) #1 \vendor\laravel\framework\src\Illuminate\Foundation\Http\Kernel.php(314): App\Exceptions\Handler->report(Object(Symfony\Component\Debug\Exception\FatalThrowableError)) #2 \vendor\laravel\framework\src\Illuminate\Foundation\Http\Kernel.php(122): Illuminate\Foundation\Http\Kernel->reportException(Object(Symfony\Component\Debug\Exception\FatalThrowableError)) #3 \public\index.php(55): Illuminate\Foundation\Http\Kernel->handle(Object(Illuminate\Http\Request)) #4 {main} thrown in \vendor\laravel\framework\src\Illuminate\Support\Facades\Facade.php on line 218

I haven't found anything about it. I am not using Lumen, I am using Laravel, upgraded from 5.5 to 5.6 by following the upgrade intstructions.

I managed to see that the error seems to lie somewhere here:

$response = $kernel->handle(
    $request = Illuminate\Http\Request::capture()
);
0 likes
15 replies
jlrdw's avatar

Did you check and double-check all the upgrade steps in the documentation.

https://laravel.com/docs/5.6/upgrade

Also try backing up everything first and make sure composer is correctly configured for 5.6.

Run composer clearcache

Then try deleting vendor folder And running composer update.

I don't see where many others have had similar trouble, I suspect do you may have missed one thing in the upgrade guide

Synatex's avatar

Yes. I upgraded everything according to it. I have rolled it back now to 5.5 to see if I did any mistakes, when I did 5.6 again it came up with the same errors.

I have a few extra packages, also thought they might be bugged in the upgrade, but also had a working version for 5.6 ready.

jlrdw's avatar

You need to insure each package you added is compatible with 5.6.

Me I normally install new version and just put my code over. Usually does not take that long.

kerryjones's avatar

I have the same problem -- there needs to be a better solution

1 like
Synatex's avatar

Sadly not. I stuck to not upgrading until we deploy to production, most likely will have to find a solution then. Will keep you guys updated, maybe someone else has an idea.

Shahrukh4's avatar

Try running following commands,

 php artisan config:cache
 php artisan config:clear
 php artisan cache:clear
 composer update
2 likes
epicgear's avatar

I had the same issue and ended up just moving my code over to a fresh installed 5.6.*

oleonides's avatar

@Shahrukh4 'answer worked for me, I only run this command php artisan config:cache and my site was up back, thanks a lot.

1 like
archy_bold's avatar

This is probably too late for the OP but might help some others you have this issue. I was experiencing this particular issue when running phpunit. My problem was that I had a listener registered in phpunit.xml that made use of the File facade. Simply changing those to be php file functions solved the issue. Hope this helps someone.

1 like
roark's avatar

Issue for me was a typo in the config.

1 like
icemancast's avatar

Same issue uptrading to Laravel 5.4 on a shift. It works locally on valet but not on production.

jason-mccreary's avatar

This may happen even in recent versions of Laravel. This message unfortunately does not come with a lot of details other than the Facade method which was called.

However, after upgrading hundreds of Laravel applications via Shift, the most common cause is an error within your one of your config files.

The easiest way to determine the last config file loaded is by temporarily adding an echo statement within Laravel as it loads the configuration files.

You may do so within the loadConfigurationFiles method of the Illuminate\Foundation\Bootstrap\LoadConfiguration class around line 71.

If all the configuration files load correctly, then you are likely referencing a custom Facade which you have not bound properly within the container. In which case, this exception is the expected behavior.

Please or to participate in this conversation.