Ad

Warning: Require(/var/www/vendor/autoload.php):

- 1 answer

I am good with API creation but not so good when it comes to set up the system, I was trying to learn setting laravel with docker and was referring: https://medium.com/@shakyShane/laravel-docker-part-1-setup-for-development-e3daaefaf3c

I followed all the steps correctly but on running:

docker-compose exec app php artisan key:generate

I am getting error:

Warning: require(/var/www/vendor/autoload.php): failed to open stream: No such file or directory in /var/www/artisan on line 18

Fatal error: require(): Failed opening required '/var/www/vendor/autoload.php' (include_path='.:/usr/local/lib/php') in /var/www/artisan on line 18

Am I wrong to assume that this problem is because the composer hasn't run!!

My Project folder is in Desktop

my docker-compose.yml is written like:

  # The Application
  `app:`
    `build:`
      `context: ./`
      `dockerfile: app.dockerfile`
    `working_dir: /var/www`
   `volumes:`
      `- ./:/var/www``
   ` environment:`
      `- "DB_PORT=3306"`
      `- "DB_HOST=database"`

  # The Web Server
  `web:`
    `build:`
      `context: ./`
      `dockerfile: web.dockerfile`
    `working_dir: /var/www`
    `volumes_from:`
      `- app`
    `ports:`
      `- 8080:80`

I checked other solutions on the web but I couldn't quite understand how I need to do.

Ad

Answer

I think it is not a good idea to follow the steps provided in the website since the

composer image is DEPRECATED

you must use the newest one from here

Ad
source: stackoverflow.com
Ad