The Composer settings ignore the version matching method and composer match. Composer settings ignore version matching methods. composer matches Composer introduction Composer is a dependency management tool of PHP. It allows you to declare the code library on which the project depends. it will ignore version matching methods in your Composer settings, and composer matching
Introduction to Composer
Composer is a dependency management tool for PHP. It allows you to declare the code library on which the project depends, and it will install them for you in your project. Composer is not a package manager. Yes, it involves "packages" and "libraries", but it is managed based on each project and installed in a directory of your project (such as vendor. By default, it does not install anything globally. Therefore, this is just dependency management.
An error occurred while executing composer install: 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$ sudo composer installLoading composer repositories with package informationInstalling dependencies (including require-dev) from lock fileYour requirements could not be resolved to an installable set of packages.Problem 1- Installation request for doctrine/instantiator 1.0.3 -> satisfiable by doctrine/instantiator[1.0.3].- doctrine/instantiator 1.0.3 requires php ~5.3 -> your PHP version (7.0.3) does not satisfy that requirement.Problem 2- doctrine/instantiator 1.0.3 requires php ~5.3 -> your PHP version (7.0.3) does not satisfy that requirement.- phpunit/phpunit-mock-objects 2.3.0 requires doctrine/instantiator ~1.0,>=1.0.1 -> satisfiable by doctrine/instantiator[1.0.3].- Installation request for phpunit/phpunit-mock-objects 2.3.0 -> satisfiable by phpunit/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:
composer install --ignore-platform-reqs
Or
composer update --ignore-platform-reqs
Run the composer command again to run the installation package normally.
If a warning is prompted:
Cannot create cache directory /home/vagrant/.composer/cache/repo/https---packagist.org/, or directory is not writable. Proceeding without cacheCannot create cache directory /home/vagrant/.composer/cache/files/, or directory is not writable. Proceeding without cache
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.
sudo chmod -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:
composer config -g repo.packagist composer https://packagist.phpcomposer.com
OK.
Composer is a dependency management tool of PHP. It allows you to declare the code library on which the project depends, and it will be stored in your...