composer安装期间出错--使用Symfony 2的ElasticBeanstalk中没有开发选项

composer安装期间出错--使用Symfony 2的ElasticBeanstalk中没有开发选项,symfony,composer-php,amazon-elastic-beanstalk,Symfony,Composer Php,Amazon Elastic Beanstalk,我正在ElasticBeanstalk中部署Symfony 2应用程序,但当我运行此应用程序时,我收到一个错误消息 ERROR: Sensio\Bundle\GeneratorBundle\SensioGeneratorBundle class not found. 我有这个配置 container_commands: 110-remove-pg: command: "yum remove -y php56-pgsql" 120-install-pglib:

我正在ElasticBeanstalk中部署Symfony 2应用程序,但当我运行此应用程序时,我收到一个错误消息

ERROR: Sensio\Bundle\GeneratorBundle\SensioGeneratorBundle class not found.
我有这个配置

container_commands: 
    110-remove-pg: 
    command: "yum remove -y php56-pgsql"

    120-install-pglib: 
    command: "yum install -y postgresql94-libs"

    130-install-pg: 
    command: "yum install -y php56-pgsql"

    140-clear-folder: 
    command: "rm -rf var/cache/* var/logs/* var/sessions/*"

    150-folder-config: 
    command: "source .ebextensions/bin/folder.sh"

    160-pre-cache-clear: 
    command: "php bin/console cache:clear --env=prod --no-debug"

    170-run-export: 
    command: "export SYMFONY_ENV=prod"

    180-composer-install-no-dev: 
    command: "composer.phar install --no-dev --optimize-autoloader"

    190-post-cache-clear: 
    command: "php bin/console cache:clear --env=prod --no-debug"

    200-assets-dump: 
    command: "php bin/console assetic:dump --env=prod --no-debug"

    210-remove-dev-app: 
    command: "rm web/app_dev.php"

似乎它仍在触发DEV选项。如果我删除--no dev选项,它就可以正常工作。但是我不想要开发包。无论如何都有办法解决这个问题。

好的,我找到了这个问题的解决办法。显然你需要把

SYMFONY_ENV=prod

如果(在_数组($this->getEnvironment(),array('dev','test')){…$bundles[]=new Sensio\Bundle\GeneratorBundle\SensioGeneratorBundle();…},则可能在每个环境的AppKernel中都包含SensioGeneratorBundle(应该只包含在dev中)