Troubleshooting “require_once(../bootstrap.php.cache): failed to open stream: No such file or directory”

前端 未结 3 425
故里飘歌
故里飘歌 2020-12-29 01:46

I am trying to redeploy a Symfony 2.1x project I have been working on and app_dev.php is failing because it can\'t find app/bootstrap.php.cache. Th

相关标签:
3条回答
  • 2020-12-29 02:18

    You have duplicated post-install-cmd and post-updated-cmd while you should have added MopaBootstrapBundle scripts to existing keys. Try the following composer.json and re-run php composer.phar install

    {
        "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.*",
            "doctrine/doctrine-bundle": "dev-master",
            "twig/extensions": "dev-master",
            "symfony/assetic-bundle": "dev-master",
            "symfony/swiftmailer-bundle": "dev-master",
            "symfony/monolog-bundle": "dev-master",
            "sensio/distribution-bundle": "dev-master",
            "sensio/framework-extra-bundle": "dev-master",
            "sensio/generator-bundle": "dev-master",
            "jms/security-extra-bundle": "1.1.*",
            "jms/di-extra-bundle": "1.0.*",
            "ddeboer/guzzle-bundle": "dev-master",
            "mopa/bootstrap-bundle": "dev-master",
            "twitter/bootstrap": "master",
            "knplabs/knp-paginator-bundle": "dev-master",
            "knplabs/knp-menu-bundle": "dev-master",
            "craue/formflow-bundle": "dev-master"
        },
        "repositories": [
            {
                "type": "package",
                "package": {
                    "version": "master",
                    "name": "twitter/bootstrap",
                    "source": {
                        "url": "https://github.com/twitter/bootstrap.git",
                        "type": "git",
                        "reference": "master"
                    },
                    "dist": {
                        "url": "https://github.com/twitter/bootstrap/zipball/master",
                        "type": "zip"
                    }
                }
            }
        ],
        "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",
                "Mopa\\Bundle\\BootstrapBundle\\Composer\\ScriptHandler::postInstallSymlinkTwitterBootstrap"
            ],
            "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",
                "Mopa\\Bundle\\BootstrapBundle\\Composer\\ScriptHandler::postInstallSymlinkTwitterBootstrap"
            ]
        },
        "config": {
            "bin-dir": "bin"
        },
        "minimum-stability": "dev",
        "extra": {
            "symfony-app-dir": "app",
            "symfony-web-dir": "web"
        }
    }
    
    0 讨论(0)
  • 2020-12-29 02:20

    Just run the following command.

    php composer.phar install
    

    Source: http://symfony.com/doc/master/book/performance.html#use-bootstrap-files

    0 讨论(0)
  • 2020-12-29 02:27

    Just go to your project and generate it with composer like

    php /path/to/composer/composer.phar install
    
    0 讨论(0)
提交回复
热议问题