5
votes

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
Please edit the question and add the config/app.php file - Salim Djerbouh
Are they running the same version of PHP? - n8udd
you need to go through the stacktrace to see what is actually trying to resolve 'view' from the container as it appears it isn't bound yet - lagbox

3 Answers

4
votes

run this command in project root :

composer dump-autoload
3
votes

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

1
votes

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.