Installing APM Insight PHP Agent and Data Exporter in Docker

To effectively monitor PHP applications running inside a Docker container using Applications Manager, it is essential to install both the APM Insight PHP Agent and the Applications Manager Data Exporter within the same container. Follow the steps given below to configure your Docker environment.

Dockerfile Instructions

Update your Dockerfile to install both the PHP agent and the Data Exporter. These components are required for Applications Manager to collect performance metrics from your PHP application.

FROM php:7.4-fpm-bullseye
# Install prerequisites (skip if already installed)
RUN apt-get update && apt-get install -y wget unzip procps

# Install the APM Insight PHP agent
RUN wget -O InstallAgentPHP.zip https://www.manageengine.com/products/applications_manager/54974026/InstallAgentPHP.zip && unzip InstallAgentPHP.zip
RUN sh InstallAgentPHP.sh -lk "<YOUR_LICENSE_KEY>" -zpa.application_name "My-PHP-App"

# Install the Data Exporter (required for agent communication)
RUN wget -O InstallDataExporter.zip https://www.manageengine.com/products/applications_manager/54974026/InstallDataExporter.zip && unzip InstallDataExporter.zip
RUN sh InstallDataExporter.sh -root -nsvc -lk "<YOUR_LICENSE_KEY>" -apm.host "https://<apm_host>:<apm_port>"



# Add entrypoint script to start required services
COPY ./example-entrypoint.sh /example-entrypoint.sh
ENTRYPOINT ["sh", "/example-entrypoint.sh"]

Note: Replace <YOUR_LICENSE_KEY> with your Product Installation Key, which is available in Applications Manager under: Admin → APM Insight → Product Settings.

Entrypoint Script Example

This script ensures the Data Exporter service and PHP runtime are properly started inside the container.

#!/bin/sh

# Start the Applications Manager Data Exporter required for PHP agent communication
sh /opt/AppManagerDataExporter/bin/service.sh start

# Start PHP-FPM
php-fpm

Note:
  • The APM Insight PHP Agent and Applications Manager Data Exporter must both be installed in the same container for monitoring to work correctly.
  • Ensure the container has internet access to download the installer scripts.
  • Ensure version compatibility: PHP Agent v4.4 is not supported with Data Exporter v1.5.

Thank you for your feedback!

Was this content helpful?

We are sorry. Help us improve this page.

How can we improve this page?
Do you need assistance with this topic?
By clicking "Submit", you agree to processing of personal data according to the Privacy Policy.