sparecycle
sparecycle

Reputation: 2058

White screen and PHP error when attempting to access Laravel on Production

I added my Laravel application to a Git repository. Pushed it up and pulled it down on a fully provisioned server setup I have used for previous Laravel projects. I attempt to access my site at the .com and it is rendering a white screen. Checked my Nginx log and found the following:

   [RuntimeException]                                                                                                         
  Error Output: PHP Warning:  require(/var/www/laravel/bootstrap/vendor/autoload.php): failed to open stream: No such file   
  or directory in /var/www/laravel/bootstrap/autoload.php on line 17                                                         
  PHP Fatal error:  require(): Failed opening required '/var/www/laravel/bootstrap/vendor/autoload.php' (include_path='.:/u  
  sr/share/php:/usr/share/pear') in /var/www/laravel/bootstrap/autoload.php on line 17 

I read that you either have to include your vendor folder or run composer update/install. I tried both and still receive the same error. I thought maybe it is a permission thing so I ran chmod and chown according to the Laravel documentation. Still nothing. Any advice?

Upvotes: 1

Views: 621

Answers (1)

Jamesking56
Jamesking56

Reputation: 3901

You need to run composer install on the server to install your project's dependencies. Your dependencies aren't stored in Git by Laravel (this is a best practice) so anywhere you pull the repository you must reinstall the dependencies.

This will require you to have composer installed on the server you are trying to run Laravel onto.

Upvotes: 2

Related Questions