尝试安装symfony FOS Bundle会给我一个错误:
composer require friendsofsymfony/user-bundle "~1.3"
./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: don't install friendsofsymfony/user-bundle v1.3.7
- Conclusion: don't install friendsofsymfony/user-bundle v1.3.6
- Conclusion: don't install friendsofsymfony/user-bundle v1.3.5
- Conclusion: don't install friendsofsymfony/user-bundle v1.3.4
- Conclusion: don't install friendsofsymfony/user-bundle v1.3.3
- Conclusion: don't install friendsofsymfony/user-bundle v1.3.2
- Conclusion: don't install friendsofsymfony/user-bundle v1.3.1
- Conclusion: remove symfony/symfony v3.3.10
- Installation request for friendsofsymfony/user-bundle ~1.3 -> satisfiable by friendsofsymfony/user-bundle[v1.3.0, v1.3.1, v1.3.2, v1.3.3, v1.3.4, v1.3.5, v1.3.6, v1.3.7].
- Conclusion: don't install symfony/symfony v3.3.10
- friendsofsymfony/user-bundle v1.3.0 requires symfony/security-bundle 2.1.* -> satisfiable by symfony/security-bundle[v2.1.0, v2.1.1, v2.1.10, v2.1.11, v2.1.12, v2.1.13, v2.1.2, v2.1.3, v2.1.4, v2.1.5, v2.1.6, v2.1.7, v2.1.8, v2.1.9].
- don't install symfony/security-bundle v2.1.0|don't install symfony/symfony v3.3.10
- don't install symfony/security-bundle v2.1.1|don't install symfony/symfony v3.3.10
- don't install symfony/security-bundle v2.1.10|don't install symfony/symfony v3.3.10
- don't install symfony/security-bundle v2.1.11|don't install symfony/symfony v3.3.10
- don't install symfony/security-bundle v2.1.12|don't install symfony/symfony v3.3.10
- don't install symfony/security-bundle v2.1.13|don't install symfony/symfony v3.3.10
- don't install symfony/security-bundle v2.1.2|don't install symfony/symfony v3.3.10
- don't install symfony/security-bundle v2.1.3|don't install symfony/symfony v3.3.10
- don't install symfony/security-bundle v2.1.4|don't install symfony/symfony v3.3.10
- don't install symfony/security-bundle v2.1.5|don't install symfony/symfony v3.3.10
- don't install symfony/security-bundle v2.1.6|don't install symfony/symfony v3.3.10
- don't install symfony/security-bundle v2.1.7|don't install symfony/symfony v3.3.10
- don't install symfony/security-bundle v2.1.8|don't install symfony/symfony v3.3.10
- don't install symfony/security-bundle v2.1.9|don't install symfony/symfony v3.3.10
- Installation request for symfony/symfony (locked at v3.3.10, required as 3.3.*) -> satisfiable by symfony/symfony[v3.3.10].
Installation failed, reverting ./composer.json to its original content.
首先,它给我的错误是我的PHP版本(7.0.1)对于symfony 3.3来说太低了,它必须是atleast => 7.0.8。
所以我卸载了xampp,但保存了htdocs作为备份,得到7.1.10并再次尝试,这时我注意到netbeans中的一个laravel项目也开始出现错误和symfony项目。
所以我尝试安装FOS,此错误现在弹出,更新了我的作曲家,因为我认为它来自未更新的作曲家版本,但显然不是这样,因为错误是一样的。
我看了另一篇文章,但这不是同一个问题,所以我想在这里寻求帮助,因为我是新手。
但我明白,如果我有FOS Bundle,我的生活会更轻松,所以我真的希望它能够开始。
所以请帮助我,我该怎么办? 附:我刚从桌面剪切了我的htdocs文件夹并将其粘贴到xampp目录中并替换了元素。
这是我在symfony项目中的composer.json:
{
"name": "/docsite",
"license": "proprietary",
"type": "project",
"autoload": {
"psr-4": {
"AppBundle\\": "src/AppBundle"
},
"classmap": [
"app/AppKernel.php",
"app/AppCache.php"
]
},
"autoload-dev": {
"psr-4": {
"Tests\\": "tests/"
},
"files": [
"vendor/symfony/symfony/src/Symfony/Component/VarDumper/Resources/functions/dump.php"
]
},
"require": {
"php": ">=5.5.9",
"doctrine/doctrine-bundle": "^1.6",
"doctrine/orm": "^2.5",
"incenteev/composer-parameter-handler": "^2.0",
"sensio/distribution-bundle": "^5.0.19",
"sensio/framework-extra-bundle": "^3.0.2",
"symfony/monolog-bundle": "^3.1.0",
"symfony/polyfill-apcu": "^1.0",
"symfony/swiftmailer-bundle": "^2.3.10",
"symfony/symfony": "3.3.*",
"twig/twig": "^1.0||^2.0"
},
"require-dev": {
"sensio/generator-bundle": "^3.0",
"symfony/phpunit-bridge": "^3.0"
},
"scripts": {
"symfony-scripts": [
"Incenteev\\ParameterHandler\\ScriptHandler::buildParameters",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::prepareDeploymentTarget"
],
"post-install-cmd": [
"@symfony-scripts"
],
"post-update-cmd": [
"@symfony-scripts"
]
},
"config": {
"sort-packages": true
},
"extra": {
"symfony-app-dir": "app",
"symfony-bin-dir": "bin",
"symfony-var-dir": "var",
"symfony-web-dir": "web",
"symfony-tests-dir": "tests",
"symfony-assets-install": "relative",
"incenteev-parameters": {
"file": "app/config/parameters.yml"
},
"branch-alias": null
}
}
我的php版本:
php -v
PHP 7.1.10 (cli) (built: Sep 26 2017 20:07:27) ( ZTS MSVC14 (Visual C++ 2015) x86 )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2017 Zend Technologies
最后一个命令:
echo %path%
C:\oraclexe\app\oracle\product\11.2.0\server\bin;;C:\ProgramData\Oracle\Java\javapath;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Users\Вълкови\.dnx\bin;C:\Program Files\Microsoft DNX\Dnvm\;C:\Program Files\Microsoft SQL Server\130\Tools\Binn\;C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit\;C:\Program Files\Microsoft SQL Server\110\Tools\Binn\;C:\Program Files (x86)\Microsoft SDKs\TypeScript\1.0\;C:\Program Files\Microsoft SQL Server\120\Tools\Binn\;C:\Program Files\Git\cmd;C:\Program Files (x86)\GtkSharp\2.12\bin;C:\Program Files (x86)\Skype\Phone\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files\Liquid Technologies\Liquid Studio 2017\XmlDataBinder15\Redist15\cpp\win32\bin;C:\Program Files\Liquid Technologies\Liquid Studio 2017\XmlDataBinder15\Redist15\cpp\win64\bin;C:\xampp\php;C:\ProgramData\ComposerSetup\bin;C:\Program Files\TortoiseGit\bin;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files (x86)\QuickTime\QTSystem\;C:\Program Files\Common Files\Autodesk Shared\;C:\Program Files (x86)\Autodesk\Backburner\;C:\Users\Вълкови\AppData\Local\Microsoft\WindowsApps;C:\Users\Вълкови\AppData\Roaming\Composer\vendor\bin;C:\xampp\php\php.exe;
答案 0 :(得分:2)
问题是FOSUser 1.3不能与Symfony 3.3一起使用,你必须使用FOSUser 2.0并安装它:
composer require friendsofsymfony/user-bundle "~2.0"
这应该可以解决你的问题。