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.
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.
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
Thank you for your feedback!