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

3

4 Answers

run this command in project root :

composer dump-autoload

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

3

Make sure the following folders are writable:

  • bootstrap/cache
  • storage/framework/views

Thanks for your help guys the issue is that I never had composer installed on the server all along. Installing composer on the server fixed the issue.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

You Might Also Like