Prasanth Pillai
Prasanth Pillai

Reputation: 166

AWS Elastic Beanstalk Composer unable to pick composer.json

Im stuck with an issue generated while I'm trying deploy my PHP application using Elastic Beanstalk.

enter image description here

I have my .config in .ebextensions which is as per below

commands:
    01-composer-selfupdate:
        command: "export COMPOSER_HOME=/root && composer.phar self-update -n"
    02-composer-install:
        command: "composer.phar install --no-dev --optimize-autoloader --prefer-dist --no-interaction"
option_settings:
    -   option_name: DB_SERVER
        value: '<server details>'
    -   option_name: DB_USER
        value: '<username>'
    -   option_name: DB_PASSWORD
        value: '<password>'
    -   option_name: DB_NAME
        value: '<db name>'
    -   namespace: aws:elasticbeanstalk:application:environment
        option_name: COMPOSER_HOME
        value: /root

here is the code structure where composer is placed in root folder. enter image description here

Any help on this is highly appreciated.

Upvotes: 0

Views: 943

Answers (1)

Prasanth Pillai
Prasanth Pillai

Reputation: 166

enter image description here

Picked up from logs to find the right folder:

+ EB_APP_STAGING_DIR=/var/app/ondeck
  ++ /opt/elasticbeanstalk/bin/get-config container -k app_deploy_dir
  + EB_APP_DEPLOY_DIR=/var/app/current
  + '[' -d /var/app/current ']'
  + mv /var/app/current /var/app/current.old
  + mv /var/app/ondeck /var/app/current
  + nohup rm -rf /var/app/current.old

Upvotes: 1

Related Questions