The Composer settings ignore version matching execution composer install encountered an error: Your requirements cocould not be resolved to an installable set of packages. this is because it does not match the version required by composer. json.
The complete error is as follows:
vagrant@homestead:/usr/share/nginx/html/laravel-blog$ sudocomposerinstallLoadingcomposerrepositorieswithpackage informationInstallingdependencies (includingrequire-dev) fromlockfileYourrequirementscouldnot beresolvedto aninstallablesetofpackages. Problem 1 - Installationrequestfor doctrine/instantiator 1.0.3 -> satisfiablebydoctrine/instantiator[1.0.3]. - doctrine/instantiator 1.0.3 requiresphp ~5.3 -> yourPHPversion (7.0.3) doesnot satisfythatrequirement. Problem 2 - doctrine/instantiator 1.0.3 requiresphp ~5.3 -> yourPHPversion (7.0.3) doesnot satisfythatrequirement. - phpunit/phpunit-mock-objects 2.3.0 requiresdoctrine/instantiator ~1.0,>=1.0.1 -> satisfiablebydoctrine/instantiator[1.0.3]. - Installationrequestfor phpunit/phpunit-mock-objects 2.3.0 -> satisfiablebyphpunit/phpunit-mock-objects[2.3.0].
The prompt is that my PHP 7 version is too high and does not conform to the version required by composer. json. However, it can also be run in PHP 7. the composer can set to ignore version Matching. the command is:
composerinstall --ignore-platform-reqs
Or
composerupdate --ignore-platform-reqs
Run the composer command again to run the installation package normally.
If a warning is prompted:
Cannotcreatecachedirectory /home/vagrant/.composer/cache/repo/https---packagist.org/, or directoryis not writable. ProceedingwithoutcacheCannotcreatecachedirectory /home/vagrant/.composer/cache/files/, or directoryis not writable. Proceedingwithoutcache
This is to execute composer in the virtual machine, prompting that this directory does not have the write permission, composer cannot cache the downloaded package, so that each time you have to download again, change the directory to writable and readable.
sudochmod -R 777 /home/vagrant/.composer/cache/files/
In addition, set composer as a domestic image in the virtual machine. Otherwise, the download speed will be slow. execute:
composerconfig -g repo.packagistcomposerhttps://packagist.phpcomposer.com
OK.