Unable to install SonataUserBundle in Symfony2 2.4

2.9k views Asked by At

I can't install sonata-project/user-bundle with symfony2 2.4. Composer gives me such error message:

  Problem 1
    - Conclusion: remove symfony/symfony v2.4.0
    - Installation request for symfony/framework-standard-edition 2.4.x-dev -> satisfiable by symfony/framework-standard-edition[2.4.x-dev].
    - Conclusion: don't install symfony/symfony v2.4.0
    - Installation request for sonata-project/user-bundle 2.2.2 -> satisfiable by sonata-project/user-bundle[2.2.2].
    - Installation request for friendsofsymfony/user-bundle ~2.0@dev -> satisfiable by friendsofsymfony/user-bundle[2.0.x-dev].
    - symfony/framework-standard-edition 2.4.x-dev requires sensio/framework-extra-bundle ~3.0 -> satisfiable by sensio/framework-extra-bundle[v3.0.0].
    - sensio/framework-extra-bundle v3.0.0 requires symfony/framework-bundle ~2.4 -> satisfiable by symfony/symfony[v2.4.0], symfony/framework-bundle[v2.4.0].
    - sensio/framework-extra-bundle v3.0.0 requires symfony/framework-bundle ~2.4 -> satisfiable by symfony/symfony[v2.4.0], symfony/framework-bundle[v2.4.0].
    - Conclusion: don't install symfony/framework-bundle v2.4.0

My composer.json:

{
    "name": "symfony/framework-standard-edition",
    "license": "MIT",
    "type": "project",
    "description": "The \"Symfony Standard Edition\" distribution",
    "autoload": {
    "psr-0": { "": "src/" }
    },
    "require": {
    "php": ">=5.3.3",
    "symfony/symfony": "2.*",
    "doctrine/orm": "~2.2,>=2.2.3",
    "doctrine/doctrine-bundle": "~1.2",
    "twig/extensions": "~1.0",
    "symfony/assetic-bundle": "~2.3",
    "symfony/swiftmailer-bundle": "~2.3",
    "symfony/monolog-bundle": "~2.4",
    "sensio/distribution-bundle": "~2.3",
    "sensio/framework-extra-bundle": "~3.0",
    "sensio/generator-bundle": "~2.3",
    "incenteev/composer-parameter-handler": "~2.0",
    "friendsofsymfony/user-bundle": "~2.0@dev",
    "stof/doctrine-extensions-bundle": "~1.1@dev",
    "sonata-project/admin-bundle": "~2.1",
    "sonata-project/doctrine-orm-admin-bundle": "~2.1",
    "sonata-project/user-bundle": "2.2.2",
    "knplabs/knp-paginator-bundle": "2.3.*",
    "knplabs/knp-menu-bundle": "1.1.*",
    "knplabs/knp-menu": "1.1.*"

    },
    "scripts": {
    "post-install-cmd": [
        "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"
    ],
    "post-update-cmd": [
        "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"
    ]
    },
    "config": {
    "bin-dir": "bin"
    },
    "extra": {
    "symfony-app-dir": "app",
    "symfony-web-dir": "web",
    "incenteev-parameters": {
        "file": "app/config/parameters.yml"
    },
    "branch-alias": {
        "dev-master": "2.4-dev"
    }
    }
}

When I delete line "sonata-project/user-bundle": "2.2.2", from composer.json - composer update runs smoothly.

Is sonata-user [2.2.2] not compatible with Symfony2 2.4 ? I can't find any official info about that.

I chceck composer.json od SonataUserBundle and SonataAdminBundle (which I installed successfully), and both require "symfony/http-foundation": "~2.2", so I'm realy out of ideas...

Update

Ticket in github

https://github.com/sonata-project/SonataUserBundle/issues/300#issuecomment-31214179

2

There are 2 answers

4
ADyDyka On BEST ANSWER

Change version of friendsofsymfony/user-bundle by modifying composer.json -

"friendsofsymfony/user-bundle": "1.3.3",

and issue the command:

composer update

Worked for me on Symfony 2.4.0

1
user3041529 On

Good News!

I have added fixes to make SonataUserBundle work with FOSUserBundle 2.0*

https://github.com/sonata-project/SonataUserBundle/pull/303