---
title: Enabling the PHP Profiler
description: Datadog, the leading service for cloud-scale monitoring.
breadcrumbs: Docs > Continuous Profiler > Enabling the Profiler > Enabling the PHP Profiler
---

# Enabling the PHP Profiler

## Requirements{% #requirements %}

For a summary of the minimum and recommended runtime and tracer versions across all languages, read [Supported Language and Tracer Versions](https://docs.datadoghq.com/profiler/enabling/supported_versions.md).

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.

{% tab title="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 title="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:

```shell
apk add libgcc
```

{% /tab %}

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](https://docs.datadoghq.com/profiler/connect_traces_and_profiles.md#identify-code-hotspots-in-slow-traces) | 0.89.0+                         |
| [Endpoint Profiling](https://docs.datadoghq.com/profiler/connect_traces_and_profiles.md#break-down-code-performance-by-api-endpoints)      | 0.79.0+                         |
| [Timeline](https://docs.datadoghq.com/profiler/profile_visualizations.md#timeline-view)                                                    | 0.98.0+                         |
| [Source Code Integration](https://docs.datadoghq.com/integrations/guide/source-code-integration.md?tab=php)                                | 1.13.0+                         |

Continuous Profiler is not supported on some serverless platforms, such as AWS Lambda.

## Installation{% #installation %}

To begin profiling applications:

1. Ensure Datadog Agent v6+ is installed and running. Datadog recommends using [Datadog Agent v7+](https://app.datadoghq.com/account/settings/agent/6?platform=overview).

1. Download the `datadog-setup.php` script from the [GitHub release page](https://github.com/DataDog/dd-trace-php/releases). Version 0.69.0 is the first tracer release to include this installer.

   ```shell
   curl --proto '=https' --tlsv1.2 -sSfLO \
     https://github.com/DataDog/dd-trace-php/releases/latest/download/datadog-setup.php
   ```

1. 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.

   ```shell
   php datadog-setup.php --enable-profiling --php-bin=all
   ```

1. **Optional:** Configure the profiler using config mode through the `datadog-setup.php`:

   ```shell
   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](https://docs.datadoghq.com/tracing/trace_collection/library_config/php.md#environment-variable-configuration) for more INI settings.

1. Validate the profiler extension is loaded and enabled by executing `php -v` and validate that you see `datadog-profiling` in the output.

   ```shell
   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
   ```

1. Optional: Set up [Source Code Integration](https://docs.datadoghq.com/integrations/guide/source-code-integration.md?tab=php) to connect your profiling data with your Git repositories.

1. A couple of minutes after receiving a request, your profiles appear on the [APM > Profiler page](https://app.datadoghq.com/profiling). If they do not, refer to the [Troubleshooting](https://docs.datadoghq.com/profiler/profiler_troubleshooting/php.md) guide.

## Not sure what to do next?{% #not-sure-what-to-do-next %}

The [Getting Started with Profiler](https://docs.datadoghq.com/getting_started/profiler.md) 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{% #further-reading %}

- [Getting Started with Profiler](https://docs.datadoghq.com/getting_started/profiler.md)
- [Learn more about available profile visualizations](https://docs.datadoghq.com/profiler/profile_visualizations.md)
- [Fix problems you encounter while using the profiler](https://docs.datadoghq.com/profiler/profiler_troubleshooting/php.md)
- [Why care about exception profiling in PHP?](https://www.datadoghq.com/blog/php-exception-profiling/)
