In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
This article will explain in detail the method of ignoring version matching in Composer settings. The editor thinks it is very practical, so I share it with you for reference. I hope you can get something after reading this article.
Introduction to Composer
Composer is a dependency management tool for PHP. It allows you to declare the code base 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 on a project-by-project basis and installed in a directory of your project (such as vendor). By default, it does not install anything globally. Therefore, this is just a dependency management.
Error encountered in executing composer install: Your requirements could not be resolved to an installable set of packages. This is because the version required by composer.json does not match.
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].
It is suggested that my version of PHP 7 is too high to meet the required version of composer.json, but it should also run under PHP 7. Composer can be set to ignore version matching. The command is:
Composer install-ignore-platform-reqsorcomposer update-ignore-platform-reqs
Execute the composer command again to install the package normally.
If prompted to warn:
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, indicating that there is no writeable permission for this directory, and composer cannot cache the downloaded package, so you have to download it again every time and change the directory to writable and readable.
Sudo chmod-R 777 / home/vagrant/.composer/cache/files/
In addition, set composer as the domestic image in the virtual machine, otherwise the download speed will be extremely slow, and execute:
Composer config-g repo.packagist composer https://packagist.phpcomposer.com
OK, it's done.
So much for the method of ignoring version matching for Composer settings. I hope the above content can be of some help to you and learn more knowledge. If you think the article is good, you can share it for more people to see.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.