当我尝试在产品中安装作曲家时,我在安装作曲家时遇到以下错误,任何人都可以建议我帮助。谢谢。
Problem 1
- Installation request for doctrine/annotations v1.5.0 -> satisfiable by doctrine/annotations[v1.5.0].
- doctrine/annotations v1.5.0 requires php ^7.1 -> your PHP version (7.0.22) does not satisfy that requirement.
Problem 2
- Installation request for doctrine/cache v1.7.1 -> satisfiable by doctrine/cache[v1.7.1].
- doctrine/cache v1.7.1 requires php ~7.1 -> your PHP version (7.0.22) does not satisfy that requirement.
Problem 3
- Installation request for doctrine/collections v1.5.0 -> satisfiable by doctrine/collections[v1.5.0].
- doctrine/collections v1.5.0 requires php ^7.1 -> your PHP version (7.0.22) does not satisfy that requirement.
Problem 4
- Installation request for doctrine/common v2.8.1 -> satisfiable by doctrine/common[v2.8.1].
- doctrine/common v2.8.1 requires php ~7.1 -> your PHP version (7.0.22) does not satisfy that requirement.
Problem 5
- Installation request for doctrine/dbal v2.6.2 -> satisfiable by doctrine/dbal[v2.6.2].
- doctrine/dbal v2.6.2 requires php ^7.1 -> your PHP version (7.0.22) does not satisfy that requirement.
Problem 6
- Installation request for doctrine/instantiator 1.1.0 -> satisfiable by doctrine/instantiator[1.1.0].
- doctrine/instantiator 1.1.0 requires php ^7.1 -> your PHP version (7.0.22) does not satisfy that requirement.
Problem 7
- doctrine/instantiator 1.1.0 requires php ^7.1 -> your PHP version (7.0.22) does not satisfy that requirement.
- phpunit/phpunit-mock-objects 3.4.4 requires doctrine/instantiator ^1.0.2 -> satisfiable by doctrine/instantiator[1.1.0].
- Installation request for phpunit/phpunit-mock-objects 3.4.4 -> satisfiable by phpunit/phpunit-mock-objects[3.4.4].
这是比编辑composer.json更简单的解决方案
将切换--ignore-platform-reqs
与作曲家命令一起使用 例如
composer update --ignore-platform-reqs
要么你的 composer.lock 是在运行 PHP7.1 的计算机上制作的,但你的生产服务器运行的是 7.0.22,要么你的版本限制(我猜)原则太高了。 要绕过第一个,请将其添加到您的 composer.json 中:
...
"config": {
"platform": {
"php": "7.0.22"
}
}
...
,运行composer update
并签入生成的 composer.lock 文件。通过这种方式,您可以强制作曲家为您的生产 php 版本选择包,该版本应该与您的开发版本(7.1)兼容。