我在Symfony 2.8中安装FosUserBundle
时遇到了一些麻烦。在其他项目之前,我还没有遇到过这个问题。
我试过了:
composer require friendsofsymfony/user-bundle "~2.0"
php composer.phar update friendsofsymfony/user-bundle
"friendsofsymfony/user-bundle": "~2.0"
所需部分中composer.json
。
使用这两个选项我都会收到此错误:
C:\xampp\htdocs\MiAplicacion>composer require friendsofsymfony/user-bundle "~2 .0" ./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
- Conclusion: remove twig/twig v1.23.1
- Conclusion: don't install twig/twig v2.3.2
- Installation request for friendsofsymfony/user-bundle ~2.0 -> satisfiable by friendsofsymfony/user-bundle[v2.0.0].
- Conclusion: don't install twig/twig v1.23.1
- friendsofsymfony/user-bundle v2.0.0 requires twig/twig ^1.28 || ^2.0 -> sa tisfiable by twig/twig[v1.28.0, v1.28.1, v1.28.2, v1.29.0, v1.30.0, v1.31.0, v1.
32.0, v1.33.0, v1.33.1, v1.33.2, v2.0.0, v2.1.0, v2.2.0, v2.3.0, v2.3.1, v2.3.2] .
- Can only install one of: twig/twig[v1.28.0, v1.23.1].
- Can only install one of: twig/twig[v1.28.1, v1.23.1].
- Can only install one of: twig/twig[v1.28.2, v1.23.1].
- Can only install one of: twig/twig[v1.29.0, v1.23.1].
- Can only install one of: twig/twig[v1.30.0, v1.23.1].
- Can only install one of: twig/twig[v1.31.0, v1.23.1].
- Can only install one of: twig/twig[v1.32.0, v1.23.1].
- Can only install one of: twig/twig[v1.33.0, v1.23.1].
- Can only install one of: twig/twig[v1.33.1, v1.23.1].
- Can only install one of: twig/twig[v1.33.2, v1.23.1].
- Can only install one of: twig/twig[v2.0.0, v1.23.1].
- Can only install one of: twig/twig[v2.1.0, v1.23.1].
- Can only install one of: twig/twig[v2.2.0, v1.23.1].
- Can only install one of: twig/twig[v2.3.0, v1.23.1].
- Can only install one of: twig/twig[v2.3.1, v1.23.1].
- Installation request for twig/twig (locked at v1.23.1) -> satisfiable by t wig/twig[v1.23.1].
Installation failed, reverting ./composer.json to its original content.
我在composer.json
中的要求是(我添加了原始symfony项目的最后一行):
"require": {
"php": ">=5.3.9",
"symfony/symfony": "2.8.*",
"doctrine/orm": "^2.4.8",
"doctrine/doctrine-bundle": "~1.4",
"symfony/swiftmailer-bundle": "~2.3",
"symfony/monolog-bundle": "~2.4",
"sensio/distribution-bundle": "~5.0",
"sensio/framework-extra-bundle": "^3.0.2",
"incenteev/composer-parameter-handler": "~2.0",
"friendsofsymfony/user-bundle": "~2.0"
},
我可以解决作曲家问题吗?
如果没有,有没有办法安装FosUserBundle
手动下载并将其复制到我的项目中?
答案 0 :(得分:2)
我不知道您是手动升级到Symfony 2.8还是全新安装,但正如作曲家所示,要安装"friendsofsymfony/user-bundle": "~2.0"
,您应该至少twig ^1.28
,所以我认为你应该解决此问题,将行"twig/twig": "~1.28|~2.0"
添加到作曲家require
部分以强制升级。
如果此消息部分Installation request for twig/twig (locked at v1.23.1)
再次出现错误,您应该看看(逐个)哪个程序包阻止升级。初看起来似乎没有错误composer.json
。