The Service Map for APM is here!

Tracing PHP Applications

The APM tracer for PHP applications is in Open Public Beta.

Installation and Getting Started

To begin tracing applications written in PHP, first install and configure the Datadog Agent, see additional documentation for tracing Docker applications or Kubernetes applications.

Next, install the Datadog PHP extension using one of the precompiled packages for supported distributions. The latest packages can be found on GitHub’s releases page. If you don’t find your distribution, you can install the PHP extension from source

# using RPM package (RHEL/Centos 6+, Fedora 20+)
rpm -ivh datadog-php-tracer.rpm

# using DEB package (Debian Jessie+ , Ubuntu 14.04+)
deb -i datadog-php-tracer.deb

# using APK package (Alpine)
apk add datadog-php-tracer.apk --allow-untrusted

# using tar.gz archive (Other distributions using libc6)
tar -xf datadog-php-tracer.tar.gz -C /

Finally, install the Datadog tracing library using composer:

composer config minimum-stability beta # required to install opentracing 1.0.0-beta5
composer require opentracing/opentracing
composer require datadog/dd-trace

Note: You can install the Datadog library without changing minimum-stability


PHP APM includes support for the following PHP versions:

Version Support type
7.0.x Public Beta
7.1.x Public Beta
7.2.x Public Beta
5.6.x Public Beta

Automatic Instrumentation

Automatic instrumentation uses the ddtrace extension to modify PHP’s runtime and inject custom PHP code around specific methods. When tracing is enabled the PHP tracer is able to automatically instrument all supported libraries out of the box.

Automatic instrumentation captures:

  • Method execution time.
  • Relevant trace data, such as URL and status response codes for web requests or SQL queries for database access.
  • Unhandled exceptions, including stacktraces if available.
  • A total count of traces (e.g. web requests) flowing through the system.


Framework Compatibility

Module Versions Support Type
Laravel 5.x Public Beta
Laravel 4.2 Coming Soon
Symfony 4.x Public Beta
Symfony 3.x Public Beta
Magento 2.x Coming Soon
Zend Framework 3.x Coming Soon
CakePHP 3.x Coming Soon
Drupal 7.x Coming Soon
Wordpress 4.x Coming Soon
Yii 2.0.x Coming Soon
Slim 3.x Coming Soon

Don’t see your desired web frameworks? Let Datadog know more about your needs through this survey

Library Compatibility

Module Versions Support Type
Curl (Any Supported PHP) Public Beta
Doctrine 2.6 Coming Soon
Elasticsearch 1.x Public Beta
Eloquent Laravel supported versions Public Beta
Guzzle 5.x Public Beta
Memcached (Any Supported PHP) Public Beta
MongoDB 1.4.x Public Beta
Mysqli (Any Supported PHP) Public Beta
PDO (Any Supported PHP) Public Beta
pgsql (Any Supported PHP) Coming Soon
Predis 1.1 Public Beta

Don’t see your desired libraries? Let Datadog know more about your needs through this survey.

Further Reading