美好的一天:
我正在运行PHP 5.6,但我正在尝试安装aws/aws-sdk-php
,但是收到错误:
$ composer require aws/aws-sdk-php
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.
Problem 1
- symfony/translation v4.1.3 requires php ^7.1.3 -> your PHP version (5.6.20) does not satisfy that requirement.
- symfony/translation v4.1.3 requires php ^7.1.3 -> your PHP version (5.6.20) does not satisfy that requirement.
- Installation request for symfony/translation == 4.1.3.0 -> satisfiable by symfony/translation[v4.1.3].
Installation failed, reverting ./composer.json to its original content.
不知道为什么我得到这个问题,因为aws/aws-sdk-php
需要最低PHP 5.6但是,这些依赖需要php 7.我已经在我的供应商目录中安装了这些依赖项(通过composer)
"require" : {
"jenssegers/proxy" : "^2.2",
"league/oauth2-client" : "0.12.1",
"zendframework/zend-diactoros" : "^1.7",
"nesbot/carbon" : "^1.22"
}
正如@ rob006所提到的,我需要直接删除我的供应商并再次运行composer。
这个问题的主要原因是我最初在PHP 7系统上运行了composer install,然后在php 5.6上运行它导致了这个问题。另一个修复是在composer.json文件中设置php的platform
版本。