首页 文章

将Symfony 2.5.7部署到heroku Cloud - 找不到类'Doctrine\Bundle\DoctrineBundle\DoctrineBundle'

提问于
浏览
0

我正在尝试将我的Symfony应用程序部署到heroku并遵循Deploying to Heroku教程 .

但是,当我将我的代码发送到我的heroku应用程序时,heroku无法编译我的应用程序,并且在收到来自 composer.json 的软件包后,我收到以下消息:

创建“app / config / parameters.yml”文件PHP致命错误:第16行上的/tmp/build_45216c70c70215d5009d6aaa12fb90c1/app/AppKernel.php中找不到类'Doctrine \ Bundle \ DoctrineBundle \ DoctrineBundle'脚本Sensio \ Bundle \ DistributionBundle \ Composer \ ScriptHandler :: clearCache处理以异常终止的post-install-cmd事件[RuntimeException]执行“'cache:clear --no-warmup'”命令时发生错误 .

这是我 composer.json 的内容:

...,
"require": {
    "php": ">=5.3.3",
    "symfony/symfony": "2.5.*",
    "doctrine/orm": "~2.2,>=2.2.3",
    "twig/extensions": "~1.0",
    "symfony/assetic-bundle": "~2.3",
    "symfony/swiftmailer-bundle": "~2.3",
    "symfony/monolog-bundle": "~2.4",
    "sensio/distribution-bundle": "~3.0",
    "sensio/framework-extra-bundle": "~3.0",
    "incenteev/composer-parameter-handler": "~2.0",
    "braincrafted/bootstrap-bundle": "~2.1",
    "twbs/bootstrap": "~3.3",
    "symfony/serializer": "~2.6"
},
"require-dev": {
    "sensio/generator-bundle": "~2.3"
},
"scripts": {
    "post-root-package-install": [
        "SymfonyStandard\\Composer::hookRootPackageInstall"
    ],
    "post-install-cmd": [
        "Incenteev\\ParameterHandler\\ScriptHandler::buildParameters",
        "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
    "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
        "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile",
        "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::removeSymfonyStandardFiles"
    ],
    "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",
        "Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::removeSymfonyStandardFiles"
    ]
},
"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.5-dev"
    }
}

当我在本地机器上安装供应商时,我可以在 vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/DoctrineBundle.php 中找到 DoctrineBundle 类,所以我不明白这个错误: - (....

谢谢

1 回答

  • 1

    这是由于Symfony长期存在的问题,请参阅https://github.com/symfony/symfony/pull/12784

    您需要将Symfony升级到2.5.8或更高版本,或2.6.1或更高版本 .

    另外,请确保在 heroku config 中将 SYMFONY_ENV 设置为 prod .

相关问题