Composer settings Ignore version matching examples

Source: Internet
Author: User

The execution composer install encountered an error: Your requirements could is resolved to a installable set of packages. This is because it does not match the version requested by Composer.json.

The complete error is as follows:

Php

vagrant@homestead:/usr/share/nginx/html/laravel-blog$ sudo composer install
Loading Composer repositories with package information
Installing dependencies (including Require-dev) from lock file
Your requirements could is resolved to a 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-> by satisfiable instantiator[1.0.3].
-Installation request for phpunit/phpunit-mock-objects 2.3.0-> satisfiable by phpunit/phpunit-mock-objects[2.3.0].


Prompt my PHP 7 version is too high, does not conform to the Composer.json need version, but should also be able to run under the PHP 7, composer may set ignores the version match, the command is:


Composer Install--ignore-platform-reqs

Or

Composer Update--ignore-platform-reqs
Execute the composer command again to install the package normally.

If you are prompted to warn:


Cannot create cache Directory/home/vagrant/.composer/cache/repo/https---packagist.org/, or directory is not writable. Proceeding without cache
Cannot create cache directory/home/vagrant/.composer/cache/files/, or directory is not writable. Proceeding without cache

This is the implementation of composer in the virtual machine, indicating that this directory does not have writable permissions, composer can not cache downloaded packets, so that each time you have to download, the directory can be written to read can be changed.

sudo chmod-r 777/home/vagrant/.composer/cache/files/

In addition, in the virtual machine also set composer for the domestic mirror, or download the slow death, implementation:

Composer Config-g Repo.packagist composer https://packagist.phpcomposer.com

OK, that's it.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.