---
title: "PHP APM with AWS ECS"
slug: "php-apm-with-aws-ecs"
description: "Install PHP APM Profiler on AWS ECS for enhanced monitoring. Follow our step-by-step guide and verify results in the Retrace dashboard. Additional troubleshooting and tracking guides available."
updated: 2019-11-07T15:54:48Z
published: 2019-11-07T15:54:49Z
---

> ## Documentation Index
> Fetch the complete documentation index at: https://docs.stackify.com/llms.txt
> Use this file to discover all available pages before exploring further.

# PHP APM with AWS ECS

This document details how to install the **PHP APM Profiler** in your **PHP** application running on **AWS Elastic Container Service (ECS)**.

## Prerequisite

Follow the [Retrace AWS ECS](/docs/aws-elastic-container-service-ecs) Guide.

## PHP Application Setup

#### Dockerfile Configuration

Adjust your **Dockerfile** to include the PHP Profiler.

```
RUN mkdir -p /stackify-php-apm && \
    cd /stackify-php-apm && \
    wget https://download.stackify.com/stackify-php-apm/stackify-php-apm-latest.tar.gz;  tar -zxvf stackify-php-apm-latest.tar.gz; rm stackify-php-apm-latest.tar.gz && \
    ./install.sh

RUN echo "[stackify]" >> [php_dir]/php.ini && \
   echo "extension=stackify.so" >> [php_dir]/php.ini && \
   echo "stackify.application_name=PHP Application" >>  [php_dir]/php.ini && \
   echo "stackify.environment_name=Production" >>  [php_dir]/php.ini
```

Adjust `[php_dir]` to point to your PHP configuration path.

#### Task Configuration

Application containers are required to have the **stackify** volume mount configured in [Retrace AWS ECS](/docs/aws-elastic-container-service-ecs) Guide.

Add the **stackify** volume to the task definition:

```
{
  "volumes": [
    {
      "name": "stackify",
      "host": {
        "sourcePath": "/var/stackify"
      }
    }
  ]
}
```

Add **stackify** mount points to the container definition:

```
{
  "containerDefinitions": [
    {
      "mountPoints": [
        {
          "readOnly": false,
          "containerPath": "/usr/local/stackify",
          "sourceVolume": "stackify"
        }
      ]
    }
  ]
}
```

## Verify

Start up your PHP application task and make requests. You can then verify results in the Retrace dashboard.

## Additional Guides

- [Troubleshooting](/docs/php-apm-troubleshooting-guide)
- [Log / Deployment Tracking](/docs/php-getting-started)
