| title | Enabling the PHP Profiler | ||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| code_lang | php | ||||||||||||||||||||||||||||
| type | multi-code-lang | ||||||||||||||||||||||||||||
| code_lang_weight | 70 | ||||||||||||||||||||||||||||
| further_reading |
|
||||||||||||||||||||||||||||
| aliases |
|
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.
{{< tabs >}} {{% tab "GNU C Linux" %}}
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.
{{% /tab %}} {{% tab "Alpine Linux" %}}
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:
apk add libgcc{{% /tab %}} {{< /tabs >}}
The following profiling features are available in the following minimum versions of the dd-trace-php library:
| Feature | Required dd-trace-php version |
|---|---|
| Trace to Profiling integration | 0.89.0+ |
| Endpoint Profiling | 0.79.0+ |
| Timeline | 0.98.0+ |
| Source Code Integration | 1.13.0+ |
Continuous Profiler is not supported on some serverless platforms, such as AWS Lambda.
To begin profiling applications:
-
Ensure Datadog Agent v6+ is installed and running. Datadog recommends using Datadog Agent v7+.
-
Download the
datadog-setup.phpscript 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.2Apache, 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 -vand validate that you seedatadog-profilingin the output.php -v
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 -
Optional: Set up Source Code Integration to connect your profiling data with your Git repositories.
-
A couple of minutes after receiving a request, your profiles appear on the APM > Profiler page. If they do not, refer to the Troubleshooting guide.
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.
{{< partial name="whats-next/whats-next.html" >}}