我一直在尝试在aws elastic-beanstalk
部署我的symfony2项目,但我一直有这个错误:
Command failed on all instances.
Incorrect application version found on all instances. Expected version "app-3706-170331_113756" (deployment 6).
i-02ac339ff8d24da60 Severe 3 hours 9 - - - - - - - - - - 0.00 0.00 0.1 0.1 99.8 0.0
Application update failed at 2017-03-31T10:40:17Z with exit status 1 and error: Hook /opt/elasticbeanstalk/hooks/appdeploy/pre/10_composer_install.sh failed.
+ . /opt/elasticbeanstalk/support/envvars
++ export HOME=/root
++ HOME=/root
++ export COMPOSER_HOME=/root
++ COMPOSER_HOME=/root
++ export PHP_MEMORY_LIMIT=2048M
++ PHP_MEMORY_LIMIT=2048M
++ export PHP_MAX_EXECUTION_TIME=4000
++ PHP_MAX_EXECUTION_TIME=4000
++ export PHP_DISPLAY_ERRORS=On
++ PHP_DISPLAY_ERRORS=On
++ export PHP_COMPOSER_OPTIONS=
++ PHP_COMPOSER_OPTIONS=
++ export PHP_ALLOW_URL_FOPEN=On
++ PHP_ALLOW_URL_FOPEN=On
++ export PHP_ZLIB_OUTPUT_COMPRESSION=Off
++ PHP_ZLIB_OUTPUT_COMPRESSION=Off
++ export PHP_DOCUMENT_ROOT=
++ PHP_DOCUMENT_ROOT=
++ export PHP_DATE_TIMEZONE=UTC
++ PHP_DATE_TIMEZONE=UTC
++ /opt/elasticbeanstalk/bin/get-config container -k app_staging_dir
+ EB_APP_STAGING_DIR=/var/app/ondeck
+ cd /var/app/ondeck
+ '[' -f composer.json ']'
+ export COMPOSER_HOME=/root
+ COMPOSER_HOME=/root
+ '[' -d vendor ']'
++ /opt/elasticbeanstalk/bin/get-config optionsettings -n aws:elasticbeanstalk:container:php:phpini -o composer_options
+ PHP_COMPOSER_OPTIONS=
+ echo 'Found composer.json file. Attempting to install vendors.'
Found composer.json file. Attempting to install vendors.
+ composer.phar install --no-ansi --no-interaction
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
- Installing twig/twig (v1.27.0)
Loading from cache
- Installing symfony/symfony (v2.8.13)
Loading from cache
- Installing symfony/security-acl (dev-master 053b49b)
Cloning 053b49bf4aa333a392c83296855989bcf88ddad1
Command output has been truncated. Please see logs for more details.
Incorrect application version "app-3706-170331_123438" (deployment 9). Expected version "app-3706-170331_113756" (deployment 6).
我将Max执行时间增加到 4000 ,内存限制增加到 2048M 。
在.ebextensions
我有以下文件:
project.config
files:
"/etc/php.d/symfony.ini" :
mode: "000644"
owner: root
group: root
content: |
upload_max_filesize = 256M
post_max_size = 256M
main.config
commands:
01_update_composer:
command: export HOME=/root && export COMPOSER_HOME=/root && /usr/bin/composer.phar self-update 1.0.0-alpha11
option_settings:
- namespace: aws:elasticbeanstalk:application:environment
option_name: COMPOSER_HOME
value: /root
- namespace: aws:elasticbeanstalk:application:environment
option_name: HOME
value: /root
01-增timeout.config
option_settings:
- namespace: aws:elasticbeanstalk:command
option_name: Timeout
value: 1000