Question

I recently moved my symfony project, so I had to re-install all dependencies.

When I run php composer.phar install , I get the following error when it cames to doctrine :

[ErrorException]                                                                                                       
  file_put_contents(/Users/me/Projets/sf2/site/bin/doctrine): failed to open stream: No such file or directory

Here is a copy of 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.3.*",
        "doctrine/orm": ">=2.2.3,<2.4-dev",
        "doctrine/doctrine-bundle": "1.2.*",
        "twig/extensions": "1.0.*",
        "symfony/assetic-bundle": "2.3.*",
        "symfony/swiftmailer-bundle": "2.3.*",
        "symfony/monolog-bundle": "2.3.*",
        "sensio/distribution-bundle": "2.3.*",
        "sensio/framework-extra-bundle": "2.3.*",
        "sensio/generator-bundle": "2.3.*",
        "incenteev/composer-parameter-handler": "~2.0",
        "friendsofsymfony/user-bundle": "*",
        "friendsofsymfony/jsrouting-bundle": "@stable",
        "vich/uploader-bundle":"dev-master",
        "knplabs/knp-gaufrette-bundle":"dev-master",
        "knplabs/gaufrette":"dev-master"
    },
    "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"
    },
    "minimum-stability": "stable",
    "extra": {
        "symfony-app-dir": "app",
        "symfony-web-dir": "web",
        "incenteev-parameters": {
            "file": "app/config/parameters.yml"
        },
        "branch-alias": {
            "dev-master": "2.3-dev"
        }
    }
}
Was it helpful?

Solution

Ok, problem solved.

It appears that I migrate from windows based environment to linux based env. Beside, my folder bin was versioned (why did I do that ???) So the bin/doctrine symlink looked like this:

Windows version:

#!/usr/bin/env sh
SRC_DIR="`pwd`"
cd "`dirname "$0"`"
cd "../vendor/doctrine/orm/bin"
BIN_TARGET="`pwd`/doctrine"
cd "$SRC_DIR"
"$BIN_TARGET" "$@"

Linux version :

../vendor/doctrine/orm/bin/doctrine

Solution :

Just remove the file bin/doctrine and bin/doctrine.php and lauch php composer.phar install again

And remember to avoid putting it on versioning !

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