我正在尝试将我的Symfony应用程序部署到heroku并遵循Deploying to Heroku教程。
但是,当我将push
我的代码发送到我的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"
}
}
当我在本地计算机上安装供应商时,我可以在DoctrineBundle
中找到vendor/doctrine/doctrine-bundle/Doctrine/Bundle/DoctrineBundle/DoctrineBundle.php
类,所以我不明白这个错误: - (....
谢谢
答案 0 :(得分:1)
这是由于Symfony中的一个长期问题,请参阅https://github.com/symfony/symfony/pull/12784
您需要将Symfony升级到2.5.8或更高版本,或2.6.1或更高版本。
另外,请务必在SYMFONY_ENV
中将prod
设置为heroku config
。