Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to fix "Uncaught ReflectionException: Class view does not exist" in Laravel after deployment to Ubuntu 18.04 server

I am currently hosting an application on a ubuntu 16.04 server... but when i try to deploy the same code on fresh ubuntu 18.04 server i get the following error on my apache logs

PHP Fatal error: Uncaught ReflectionException: Class view does not exist in /var/www/xxxxxxxxxxxx/public_html/vendor/laravel/framework/src/Illuminate/Container/Container.php:788

navigating to that line of code on my laravel project was

$reflector = new ReflectionClass($concrete);

I cleared the config in bootstrap/cache and ran composer dump-autoload to no avail

like image 446
swaggerjacker Avatar asked Oct 15 '19 15:10

swaggerjacker


3 Answers

run this command in project root :

composer dump-autoload
like image 111
Ahmed Atoui Avatar answered Nov 03 '22 09:11

Ahmed Atoui


The answer is to run composer dump-autoload -o. Notice the -o.

like image 5
Theodore R. Smith Avatar answered Nov 03 '22 11:11

Theodore R. Smith


Make sure the following folders are writable:

  • bootstrap/cache
  • storage/framework/views
like image 2
i.amniels Avatar answered Nov 03 '22 10:11

i.amniels