故障排除“require_once(../bootstrap.php.cache): 无法打开流:没有这样的文件或目录" [英] Troubleshooting "require_once(../bootstrap.php.cache): failed to open stream: No such file or directory"

查看:75
本文介绍了故障排除“require_once(../bootstrap.php.cache): 无法打开流:没有这样的文件或目录"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试重新部署我一直在处理的 Symfony 2.1x 项目,app_dev.php 失败,因为它找不到 app/bootstrap.php.cache.这个文件在项目的 git 仓库中被省略了,因为我使用了 Symfony2 推荐的 .gitignore 文件:

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. This file is omitted from the project's git repository because I used Symfony2's recommend .gitignore file:

# .gitignore
/app/bootstrap*

我是否认为 app/bootstrap.php.cache 是在 $ php composer.phar install 过程中生成的?如果是这种情况,那么我将为您包含我的 composer.json:

Am I correct in thinking that app/bootstrap.php.cache is generated during the $ php composer.phar install process? If this is the case then I will include for you my composer.json:

// 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.*",
        "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"
        ],
        "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"
        ],
        "post-install-cmd": [
            "Mopa\\Bundle\\BootstrapBundle\\Composer\\ScriptHandler::postInstallSymlinkTwitterBootstrap"
        ],
        "post-update-cmd": [
            "Mopa\\Bundle\\BootstrapBundle\\Composer\\ScriptHandler::postInstallSymlinkTwitterBootstrap"
        ]
    },
    "config": {
        "bin-dir": "bin"
    },
    "minimum-stability": "dev",
    "extra": {
        "symfony-app-dir": "app",
        "symfony-web-dir": "web"
    }
}

如何生成bootstrap.php.cache?

推荐答案

只需转到您的项目并使用 Composer like 生成它

Just go to your project and generate it with composer like

php /path/to/composer/composer.phar install

这篇关于故障排除“require_once(../bootstrap.php.cache): 无法打开流:没有这样的文件或目录"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆