After cloning a project and run the command composer install
, it shows these errors.
Your lock file does not contain a compatible set of packages. Please run composer update.
Problem 1 - cache/adapter-common is locked to version 0.4.0 and an update of this package was not requested. - cache/adapter-common 0.4.0 requires php ^5.6 || ^7.0 -> your php version (8.0.0) does not satisfy that requirement.
Problem 2 - cache/filesystem-adapter is locked to version 0.4.0 and an update of this package was not requested. - cache/filesystem-adapter 0.4.0 requires php ^5.6 || ^7.0 -> your php version (8.0.0) does not satisfy that requirement.
Problem 3 - cache/tag-interop is locked to version 1.0.0 and an update of this package was not requested. - cache/tag-interop 1.0.0 requires php ^5.5 || ^7.0 -> your php version (8.0.0) does not satisfy that requirement.
When I update the .env file according to the Laravel doc https://laravel.com/docs/8.x/upgrade#php-7.3.0-required then run a command composer update
it shows an error again
Your requirements could not be resolved to an installable set of packages.
Problem 1 - Root composer.json requires php 7.3.0. but your php version (8.0.0) does not satisfy that requirement.
Problem 2 - Root composer.json requires cache/filesystem-adapter ^0.4.0 -> satisfiable by cache/filesystem-adapter[0.4.0]. - cache/filesystem-adapter 0.4.0 requires php ^5.6 || ^7.0 -> your php version (8.0.0) does not satisfy that requirement.
Problem 3 - Root composer.json requires doctrine/dbal 2.9.2 -> satisfiable by doctrine/dbal[v2.9.2]. - doctrine/dbal v2.9.2 requires php ^7.1 -> your php version (8.0.0) does not satisfy that requirement.
Problem 4 - laravel/passport[v7.2.0, ..., v7.5.1] require guzzlehttp/guzzle ~6.0 -> found guzzlehttp/guzzle[6.0.0, ..., 6.5.5] but it conflicts with your root composer.json require (^7.0.1). - Root composer.json requires laravel/passport ^7.2 -> satisfiable by laravel/passport[v7.2.0, ..., v7.5.1].Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.
How to update the composer.json for another one also plz help me.
To resolve this type of the same problem Just upgrade or degrade your PHP versions. Just do the following steps.