Enabling the PHP Profiler
Requirements
For a summary of the minimum and recommended runtime and tracer versions across all languages, read Supported Language and Tracer Versions.
The Datadog Profiler requires at least PHP 7.1, on 64-bit Linux.
PHP ZTS builds are supported since dd-trace-php version 0.99+, while PHP debug builds are not supported.
An operating system with glibc 2.17 or newer is required. The following versions or newer meet this requirement:
- CentOS 7
- Debian 8
- Ubuntu 14.04
Note: The operating system versions above have all reached end of life (EOL), Datadog recommends running more recent versions.
Version 3.13 or newer of Alpine Linux is required because the profiler is built against musl v1.2.
Additionally you need to install libgcc_s with:
The following profiling features are available in the following minimum versions of the dd-trace-php library:
Continuous Profiler is not supported on some serverless platforms, such as AWS Lambda.
Installation
To begin profiling applications:
Ensure Datadog Agent v6+ is installed and running. Datadog recommends using Datadog Agent v7+.
Download the datadog-setup.php script from the GitHub release page. Version 0.69.0 is the first tracer release to include this installer.
curl --proto '=https' --tlsv1.2 -sSfLO \
https://github.com/DataDog/dd-trace-php/releases/latest/download/datadog-setup.php
Run the installer to install both the tracer and profiler. This script is interactive and asks which of the detected PHP locations it should install to. At the end of the script, it outputs the non-interactive version of the command arguments for future use.
php datadog-setup.php --enable-profiling --php-bin=all
Optional: Configure the profiler using config mode through the datadog-setup.php:
php datadog-setup.php config set \
-d datadog.service=app-name \
-d datadog.env=prod \
-d datadog.version=1.3.2
Apache, PHP-FPM, FrankenPHP and other servers require a restart after changing the INI settings.
See the configuration docs for more INI settings.
Validate the profiler extension is loaded and enabled by executing php -v and validate that you see datadog-profiling in the output.
PHP 8.4.13 (cli) (built: Sep 5 2025 11:52:54) (ZTS)
Copyright (c) The PHP Group
Zend Engine v4.4.13, Copyright (c) Zend Technologies
with Zend OPcache v8.4.13, Copyright (c), by Zend Technologies
with datadog-profiling v1.13.0, Copyright Datadog, by Datadog
A minute or two after receiving a request, profiles appear on the APM > Profiler page.
Not sure what to do next?
The Getting Started with Profiler guide takes a sample service with a performance problem and shows you how to use Continuous Profiler to understand and fix the problem.
Further Reading
Additional helpful documentation, links, and articles: