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

RafaelMunoznl's avatar

Laravel-boilerplate - RuntimeException: A facade root has not been set.

I have used the boilerplate ion my app and everything was fine until I tried to deploy it using Cloudways

I get a blank page and the logs show the following error:

[Thu Feb 20 07:42:43.864771 2020] [proxy_fcgi:error] [pid 11114] [client 46.189.69.156:32802] AH01071: Got error 'PHP message: PHP Fatal error: Uncaught RuntimeException: A facade root has not been set. in /home/363286.cloudwaysapps.com/dujbzkuhwg/public_html/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php:236\nStack trace:\n#0 

/home/363286.cloudwaysapps.com/dujbzkuhwg/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/Handler.php(407): Illuminate\Support\Facades\Facade::__callStatic('replaceNamespac...', Array)\n#1 

/home/363286.cloudwaysapps.com/dujbzkuhwg/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/Handler.php(384): Illuminate\Foundation\Exceptions\Handler->registerErrorViewPaths()\n#2 

/home/363286.cloudwaysapps.com/dujbzkuhwg/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/Handler.php(295): Illuminate\Foundation\Exceptions\Handler->renderHttpException(Object(Symfony\Component\HttpKernel\Exception\HttpException))\n#3 

/home/363286.cloudwaysapps.com/dujbzkuhwg/public_html/vendor/laravel/framework/src/Illuminate/Foundation/Ex...\n' 

I have been searching the Internet and trying in my application without success.

I have deployed a fresh Laravel install with the boilerplate with the same results which makes me believe it is not an issue related to my code.

Any idea how to proceed?

0 likes
14 replies
Sinnbeck's avatar

Did you remember to run all the commands? composer install, create env, generate key ?

RafaelMunoznl's avatar

@sinnbeck yes, I have developed the whole app. And works locally The problem appears once I deployed it. I got a blank page online

Sinnbeck's avatar
Sinnbeck
Best Answer
Level 102

You need to run those commands on the server as well

composer install
cp .env.example .env
php artisan key:generate
RafaelMunoznl's avatar

@sinnbeck but I just deployed another app without boilerplate in the same server last month and works out ofthe box. That is the beauty if one button deployment in cloudways

Sinnbeck's avatar

Oh so you dont use version control? You just upload via ftp or the likes I assume?

Another possibility is that the webserver user does not have access to the files.

Sinnbeck's avatar

Your vendor folder isn't in version control (git), and you therefor have to run composer install to create it :)

Sinnbeck's avatar

Correct. If you look at the folders on the server I would assume there is no vendor folder?

Sinnbeck's avatar

Remember to do it as the user that you use for the webserver

For instance

sudo -u www-data composer install
Sinnbeck's avatar

You should also check that the webserver user owns the folder

ls - la
RafaelMunoznl's avatar

@sinnbeck That was the issue. I forgot to run the composer install, and the key generator in the server as well. Now it works as expected. Thanks a lot

Please or to participate in this conversation.