0

I have cloned a laravel 9 project which is working in the System it created. The laravel project uses sail to run the project in PHP 8. I am not able to run the local version in the system where I cloned the project. I tried the following code as per the documentation

docker run --rm \
    -u "$(id -u):$(id -g)" \
    -v $(pwd):/var/www/html \
    -w /var/www/html \
    laravelsail/php81-composer:latest \
    composer install --ignore-platform-reqs

This gives an error telling a composer.json is not found

I have then tried docker compose up

and it fails at the first building phase

My PHP version is 7.4 but I need PHP 8 in the container to run laravel 9

Can anyone explain how I can run git cloned dockerized laravel 9

Marcin Orlowski
  • 72,056
  • 11
  • 123
  • 141
Asish Antony
  • 85
  • 2
  • 11

1 Answers1

0

double check if composer.json is there it must be since it contains all the configuration packages, dependencies, etc. Once you find it run the following commands on the terminal:

  1. composer install
  2. composer update -o --optimize-autoloader
  3. composer dump-autoload -o --optimize

Be sure to not get any dependency error and/or version conflicts and finally run:

php artisan serve, so the app runs in localhost:8000

jmvcollaborator
  • 2,141
  • 1
  • 6
  • 17