Help Docs

Install PHP Agent in AWS Beanstalk

The following instructions will guide you through the installation of PHP Agent in AWS Beanstalk environment.

  1. Download PHP agent from the Site24x7 client
  2. Extract the agent, this will create a directory called zpa
  3. Create a file called zpa.config and copy the below given script into it
  4. files:
     "/opt/elasticbeanstalk/hooks/appdeploy/post/apminstall.sh":
      mode: "000755"
      owner: root
      group: root
      content: |
        #!/bin/bash
        APM_KEY=$(/opt/elasticbeanstalk/bin/get-config environment -k MONITORING_APM_LICENSE 2>&1)
        APM_NAME=$(/opt/elasticbeanstalk/bin/get-config environment -k MONITORING_APM_NAME 2>&1)
        cd /opt/
        rm agent_php.zip -f
        wget -O agent_php.zip https://staticdownloads.site24x7.com/apminsight/agents/agent_php.zip
        unzip -o agent_php.zip
        cd /opt/zpa/bin
        rm instance.out
        sh run.sh stop
        sh configure.sh ${APM_KEY} ${APM_NAME}
        sh run.sh start
    commands:
    install_apm:
    command:
    "bash /opt/elasticbeanstalk/hooks/appdeploy/post/apminstall.sh"
  5. Copy zpa.config file in .ebextensions directory
  6. Edit your EBS application configuration and add 2 keys, MONITORING_APM_LICENSE (mandatory, give your site24x7 license key) and MONITORING_APM_NAME (optional-if not given application will appear under PHP-Application name in APM dashboard) as shown in the following image
  7. Restart application server from Action menu on the right side of your beanstalk console.

Was this document helpful?

Shortlink has been copied!