4

I'm trying to deploy a website built on Laravel to an amazon ec2 micro instance. I've cloned the project and then ran composer install with no problems. However when I view it in the browser I get the error:

Error in exception handler..

In the error logs I can see the following error:

[Wed Nov 12 12:12:47.550414 2014] [:error] [pid 21572] [client x.x.x.x:x] PHP Fatal
error:  require(): Failed opening required '/home/production/public_html/kcnr-tv/bootstrap
/../vendor/autoload.php' (include_path='.:/usr/share/php:/usr/share/pear') in
 /home/production/public_html/kcnr-tv/bootstrap/autoload.php on line 17

I've googled this problem and a few people seem to have this issue but in almost all cases they have forgotten to run composer install.

I've increased the PHP memory limit to 1GB and still no luck. There doesn't appear to be an issue with installing dependencies as far as I can see as they are all in the vendor folder after composer has finished.

Any help with this would be great as I'm all out of ideas to what this could be.

  • @itachi what do you mean? It is an AWS instance yeah. –  Nov 12 '14 at 13:19
  • do you use `git` while uploading to AWS? – itachi Nov 12 '14 at 13:20
  • @itachi I installed the project with `git clone`. It that what you mean? –  Nov 12 '14 at 13:21
  • while adding files, did you use _force_ flag? what flags you added with `git add `? – itachi Nov 12 '14 at 13:22
  • no flags. my whole project is in `git`. and works perfectly locally. i've deployed it by cloning the repo, running `composer install`. Then I get the above error while trying to access it. –  Nov 12 '14 at 13:23
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/64788/discussion-between-chris-till-and-itachi). –  Nov 12 '14 at 13:24

4 Answers4

5

try this command

composer install --no-script

this will skip the composer scripts execution as vendor files are still missing.

Jomaf
  • 91
  • 1
  • 4
1

I fixed it with the following solution: Error in exception handler. - Laravel.

The app/storage permissions needed updating.

Community
  • 1
  • 1
1

You need to run to

composer update
Excellent Lawrence
  • 946
  • 11
  • 11
1

Use dump-autoload to generate new autoload.php

composer dump-autoload

use artisan optimize to clean the project

php artisan optimize:clear

If you are on Linux you need to set write permission to bootstrap/cache and storage directories.

sudo chmod -R 777 bootstrap/cache storage
idimma
  • 11
  • 2