title: Deploy error with Laravel project on Shared Hosting (Uncaught RuntimeException: A facade root has not been set)
body: <p>I'm deploying a laravel project into production enviroment on a shared host using FTP following this <a href="https://www.youtube.com/watch?v=6g8G3YQtQt4" rel="nofollow noreferrer">tutorial</a> except the creation of the symbolic link beacuse I'm not using the local storage but ran into &quot;Uncaught RuntimeException: A facade root has not been set&quot; error.</p>
  <p>Aditional info:</p>
  <ol>
  <li>I tried with a new laravel project with the command <code>composer create-project laravel/laravel project_name 9</code> and deployed without run it in my computer and got the same error, then I tested it on my computer and worked fine.</li>
  <li>The host was configured to follow these route: /web/content, where is displayed the public files. I followed the tutorial routing and created a folder with project's name with all files except the public folder contents as showed in the tutorial but I got the error, so I thought that the structure was giving me the error so I rename the laravel public folder to content and now all files are inside in /web and still getting the error.</li>
  <li><strong>Server info:</strong> Linux/Apache/PHP-8</li>
  <li><strong>Development enviroment:</strong> Windows 10/XAMPP/PHP-8.1</li>
  <li>For development testing I use <code>php artisan serve</code> rather than XAMPP</li>
  <li>I've deployed the project in my personal Heroku and all is working fine, as an additional test, I've deployed the project via XAMPP on my computer following the same structure in the point 2 and works fine.</li>
  </ol>
  <p>Checking the logs I got this:</p>
  <p><strong>Server Logs</strong></p>
  <pre><code>[17-Jul-2022 18:40:36 America/Chicago] PHP Fatal error:  Uncaught RuntimeException: A facade root has not been set. in /mnt/stor2-wc1-dfw1/406060/2039643/domain/web/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php:334
  Stack trace:
  #0 /mnt/stor2-wc1-dfw1/406060/2039643/domain/web/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/RegisterErrorViewPaths.php(18): Illuminate\Support\Facades\Facade::__callStatic('replaceNamespac...', Array)
  #1 /mnt/stor2-wc1-dfw1/406060/2039643/domain/web/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/Handler.php(626): Illuminate\Foundation\Exceptions\RegisterErrorViewPaths-&gt;__invoke()
  #2 /mnt/stor2-wc1-dfw1/406060/2039643/domain/web/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/Handler.php(607): Illuminate\Foundation\Exceptions\Handler-&gt;registerErrorViewPaths()
  #3 /mnt/stor2-wc1-dfw1/406060/2039643/domain/web/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/Handler.php(538): Illuminate\Foundation\Exceptions\Handler-&gt;renderHttpException(Object(Symfony\Component\HttpKernel\Exception\HttpException))
  #4 /mnt/stor2-wc1-dfw1/406060/2039643/domain/web/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/Handler.php(444): Illuminate\Foundation\Exceptions\Handler-&gt;prepareResponse(Object(Illuminate\Http\Request), Object(Symfony\Component\HttpKernel\Exception\HttpException))
  #5 /mnt/stor2-wc1-dfw1/406060/2039643/domain/web/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/Handler.php(363): Illuminate\Foundation\Exceptions\Handler-&gt;renderExceptionResponse(Object(Illuminate\Http\Request), Object(ParseError))
  #6 /mnt/stor2-wc1-dfw1/406060/2039643/domain/web/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(427): Illuminate\Foundation\Exceptions\Handler-&gt;render(Object(Illuminate\Http\Request), Object(ParseError))
  #7 /mnt/stor2-wc1-dfw1/406060/2039643/domain/web/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(115): Illuminate\Foundation\Http\Kernel-&gt;renderException(Object(Illuminate\Http\Request), Object(ParseError))
  #8 /mnt/stor2-wc1-dfw1/406060/2039643/domain/web/content/index.php(51): Illuminate\Foundation\Http\Kernel-&gt;handle(Object(Illuminate\Http\Request))
  #9 {main}
    thrown in /mnt/stor2-wc1-dfw1/406060/2039643/domain/web/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php on line 334
  </code></pre>
  <p><strong>Laravel Logs</strong></p>
  <pre><code>[2022-07-17 18:40:36] laravel.EMERGENCY: Unable to create configured logger. Using emergency logger. {&quot;exception&quot;:&quot;[object] (InvalidArgumentException(code: 0): Log [] is not defined. at /mnt/stor2-wc1-dfw1/406060/2039643/domain/web/vendor/laravel/framework/src/Illuminate/Log/LogManager.php:207)
  [stacktrace]
  #0 /mnt/stor2-wc1-dfw1/406060/2039643/domain/web/vendor/laravel/framework/src/Illuminate/Log/LogManager.php(132): Illuminate\\Log\\LogManager-&gt;resolve(NULL, NULL)
  #1 /mnt/stor2-wc1-dfw1/406060/2039643/domain/web/vendor/laravel/framework/src/Illuminate/Log/LogManager.php(119): Illuminate\\Log\\LogManager-&gt;get(NULL)
  #2 /mnt/stor2-wc1-dfw1/406060/2039643/domain/web/vendor/laravel/framework/src/Illuminate/Log/LogManager.php(636): Illuminate\\Log\\LogManager-&gt;driver()
  #3 /mnt/stor2-wc1-dfw1/406060/2039643/domain/web/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/Handler.php(275): Illuminate\\Log\\LogManager-&gt;error('syntax error, u...', Array)
  #4 /mnt/stor2-wc1-dfw1/406060/2039643/domain/web/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(415): Illuminate\\Foundation\\Exceptions\\Handler-&gt;report(Object(ParseError))
  #5 /mnt/stor2-wc1-dfw1/406060/2039643/domain/web/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(113): Illuminate\\Foundation\\Http\\Kernel-&gt;reportException(Object(ParseError))
  #6 /mnt/stor2-wc1-dfw1/406060/2039643/domain/web/content/index.php(51): Illuminate\\Foundation\\Http\\Kernel-&gt;handle(Object(Illuminate\\Http\\Request))
  #7 {main}
  &quot;} 
  [2022-07-17 18:40:36] laravel.ERROR: syntax error, unexpected token &quot;)&quot; {&quot;exception&quot;:&quot;[object] (ParseError(code: 0): syntax error, unexpected token \&quot;)\&quot; at /mnt/stor2-wc1-dfw1/406060/2039643/domain/web/vendor/symfony/finder/Finder.php:588)
  [stacktrace]
  #0 /mnt/stor2-wc1-dfw1/406060/2039643/domain/web/vendor/composer/ClassLoader.php(428): Composer\\Autoload\\includeFile('/mnt/stor2-wc1-...')
  #1 /mnt/stor2-wc1-dfw1/406060/2039643/domain/web/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/LoadConfiguration.php(88): Composer\\Autoload\\ClassLoader-&gt;loadClass('Symfony\\\\Compone...')
  #2 /mnt/stor2-wc1-dfw1/406060/2039643/domain/web/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/LoadConfiguration.php(65): Illuminate\\Foundation\\Bootstrap\\LoadConfiguration-&gt;getConfigurationFiles(Object(Illuminate\\Foundation\\Application))
  #3 /mnt/stor2-wc1-dfw1/406060/2039643/domain/web/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/LoadConfiguration.php(39): Illuminate\\Foundation\\Bootstrap\\LoadConfiguration-&gt;loadConfigurationFiles(Object(Illuminate\\Foundation\\Application), Object(Illuminate\\Config\\Repository))
  #4 /mnt/stor2-wc1-dfw1/406060/2039643/domain/web/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(239): Illuminate\\Foundation\\Bootstrap\\LoadConfiguration-&gt;bootstrap(Object(Illuminate\\Foundation\\Application))
  #5 /mnt/stor2-wc1-dfw1/406060/2039643/domain/web/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(153): Illuminate\\Foundation\\Application-&gt;bootstrapWith(Array)
  #6 /mnt/stor2-wc1-dfw1/406060/2039643/domain/web/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(137): Illuminate\\Foundation\\Http\\Kernel-&gt;bootstrap()
  #7 /mnt/stor2-wc1-dfw1/406060/2039643domain/web/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(111): Illuminate\\Foundation\\Http\\Kernel-&gt;sendRequestThroughRouter(Object(Illuminate\\Http\\Request))
  #8 /mnt/stor2-wc1-dfw1/406060/2039643/domain/web/content/index.php(51): Illuminate\\Foundation\\Http\\Kernel-&gt;handle(Object(Illuminate\\Http\\Request))
  #9 {main}
  &quot;} 
  </code></pre>
  <p><strong>UPDATE</strong></p>
  <p>By curiosity, tried with Laravel 8 and all work fine, but with Laravel 9 don't and by project's requirements, I'm not allowed to downgrade the Laravel version.</p>