Question

I'm new with Symfony2 and with composer.phar to install bundles.

Every time I want to install a new bundle I have errors. I don't know if it is my composer.json that is broken or if it is my complete installation of Symfony

# php composer.phar require friendsofsymfony/comment-bundle
Please provide a version constraint for the friendsofsymfony/comment-bundle requirement: dev-master
composer.json has been updated
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Conclusion: remove symfony/symfony 2.1.x-dev
    - Can only install one of: symfony/symfony dev-master, symfony/symfony 2.1.x-dev.
    - Can only install one of: symfony/symfony 2.2.x-dev, symfony/symfony 2.1.x-dev.
    - don't install symfony/class-loader dev-master|don't install symfony/symfony 2.1.x-dev
    - Installation request for symfony/symfony == 2.1.9999999.9999999-dev -> satisfiable by symfony/symfony 2.1.x-dev.
    - Installation request for symfony/class-loader dev-master -> satisfiable by symfony/class-loader dev-master, symfony/symfony dev-master, symfony/symfony 2.2.x-dev.

Is composer trying to tell me that I need to install symfony again ?

Here is my composer.json

{
    "name": "symfony/framework-standard-edition",
    "description": "The \"Symfony Standard Edition\" distribution",
    "autoload": {
        "psr-0": { "": "src/" }
    },
    "require": {
        "php": ">=5.3.3",
        "symfony/symfony": "2.1.*",
        "doctrine/orm": ">=2.2.3,<2.4-dev",
        "doctrine/doctrine-bundle": "1.0.*",
        "twig/extensions": "1.0.*",
        "symfony/assetic-bundle": "2.1.*",
        "symfony/swiftmailer-bundle": "2.1.*",
        "symfony/monolog-bundle": "2.1.*",
        "sensio/distribution-bundle": "2.1.*",
        "sensio/framework-extra-bundle": "2.1.*",
        "sensio/generator-bundle": "2.1.*",
        "jms/security-extra-bundle": "1.2.*",
        "jms/di-extra-bundle": "1.1.*",
        "symfony/class-loader": "dev-master",
        "friendsofsymfony/comment-bundle": "dev-master",
        "knplabs/knp-paginator-bundle": "dev-master",
        "facebook/php-sdk": "dev-master",
        "friendsofsymfony/facebook-bundle": "dev-master"
    },
    "scripts": {
        "post-install-cmd": [
            "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": [
            "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"
    },
    "minimum-stability": "dev",
    "extra": {
        "symfony-app-dir": "app",
        "symfony-web-dir": "web"
    }
}

EDIT: Because of theses errors, I had to install bundles manually (e.g. FOSFacebookBundle) so and I had to update the vendors/composer/autoload_namespaces.php (yeah, I know that's bad)

EDIT2: When I execure composer.phar update

# php composer.phar update
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Conclusion: remove symfony/symfony 2.1.x-dev
    - Conclusion: don't install symfony/symfony 2.1.x-dev
    - Conclusion: don't install symfony/symfony v2.1.4
    - Conclusion: don't install symfony/symfony v2.1.3
    - Conclusion: don't install symfony/symfony v2.1.2
    - Conclusion: don't install symfony/symfony v2.1.1
    - Conclusion: don't install symfony/symfony v2.1.0
    - Conclusion: don't install symfony/symfony v2.1.0-RC2
    - Conclusion: don't install symfony/symfony v2.1.0-RC1
    - Conclusion: don't install symfony/symfony v2.1.0-BETA4
    - Installation request for friendsofsymfony/facebook-bundle dev-master -> satisfiable by friendsofsymfony/facebook-bundle dev-master.
    - Conclusion: don't install symfony/symfony v2.1.0-BETA3
    - Installation request for symfony/class-loader dev-master -> satisfiable by symfony/class-loader dev-master, symfony/symfony dev-master, symfony/symfony 2.2.x-dev.
    - Conclusion: don't install symfony/symfony v2.1.0-BETA2
    - friendsofsymfony/facebook-bundle dev-master requires symfony/twig-bundle >=2.1,<2.3-dev -> satisfiable by symfony/symfony 2.1.x-dev, symfony/symfony 2.1.x-dev, symfony/symfony 2.2.x-dev, symfony/symfony v2.1.0, symfony/symfony v2.1.1, symfony/symfony v2.1.2, symfony/symfony v2.1.3, symfony/symfony v2.1.4, symfony/twig-bundle 2.1.x-dev, symfony/twig-bundle 2.2.x-dev, symfony/twig-bundle v2.1.0, symfony/twig-bundle v2.1.1, symfony/twig-bundle v2.1.2, symfony/twig-bundle v2.1.3, symfony/twig-bundle v2.1.4.
    - Can only install one of: symfony/symfony v2.1.0-BETA1, symfony/symfony 2.2.x-dev.
    - don't install symfony/twig-bundle 2.1.x-dev|don't install symfony/symfony v2.1.0-BETA1
    - don't install symfony/twig-bundle 2.2.x-dev|don't install symfony/symfony v2.1.0-BETA1
    - don't install symfony/twig-bundle v2.1.0|don't install symfony/symfony v2.1.0-BETA1
    - don't install symfony/twig-bundle v2.1.1|don't install symfony/symfony v2.1.0-BETA1
    - don't install symfony/twig-bundle v2.1.2|don't install symfony/symfony v2.1.0-BETA1
    - don't install symfony/twig-bundle v2.1.3|don't install symfony/symfony v2.1.0-BETA1
    - don't install symfony/twig-bundle v2.1.4|don't install symfony/symfony v2.1.0-BETA1
    - Installation request for symfony/symfony 2.1.* -> satisfiable by symfony/symfony 2.1.x-dev, symfony/symfony v2.1.0, symfony/symfony v2.1.0-BETA1, symfony/symfony v2.1.0-BETA2, symfony/symfony v2.1.0-BETA3, symfony/symfony v2.1.0-BETA4, symfony/symfony v2.1.0-RC1, symfony/symfony v2.1.0-RC2, symfony/symfony v2.1.1, symfony/symfony v2.1.2, symfony/symfony v2.1.3, symfony/symfony v2.1.4.

Thanks for your help.

Was it helpful?

Solution

Found the answer!

As simple as it seems (not for me), there was dependency on symfony/class-loader that did not references the right version.

So all I had to do is to remove the class-loader and everything's fine.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top