PHP Agent configuration

PurePath technology provides full visibility into PHP application performance and behavior: From a browser click to the database and back, for all transactions, in real time 24x7. Smart auto-detection of PHP pages lets you see which page has performance issues. The core of the solution is the instrumentation of an Agent for the Apache HTTP server PHP extension.

AppMon has extensions to instrument PHP on Windows, either in combination with the Apache HTTP Server or IIS.

Supported PHP flavors include:

  • PHP Zend Engine
  • PHP FastCGI
  • suPHP


Web servers like the Apache HTTP Server typically consist of several worker processes that handle different requests. Sometimes the processes contain several threads or one process is created for each request. Since the lifetime of worker processes is not known in advance, the Agent for web servers consists of the following parts:

  • The PHP interpreter loads the extension. It gathers the information the AppMon Server uses for analysis.
  • The Web Server Master Agent is a separate process that collects all worker process data. It handles communication with the Collector, retrieves configuration data, and performs other functions.
  • Start the Web Server Master Agent on Linux separately as a daemon (like the service on Windows) and not with the sub-Agent. See Web Server Agent Configuration.

The PHP Agent communicates with the Web Server Master Agent through these channels:

  • The shared memory segment propagates configuration data to the worker processes that the Web Server Master Agent receives from the collector, and holds other information shared across all worker processes. The shared memory segment is backed by a file on all platforms. The worker processes and the Master Agent process must have read/write access. This file is located in <dynatrace install dir>/agent/conf.
  • The PHP Agent sends collected data to the Web Server Master Agent through a stateless UDP connection. The Master Agent collects this data, transforms it, and forwards it to the AppMon Collector.

Install, configure and verify

Install, configure and start the Web Server Master Agent service / daemon. You need to at least configure the Agent name in <dynatrace install dir>/agent/conf/dtwsagent.ini that matches the mapping in your active System Profile. See Web Server Agent Configuration and Apache Web Server Agent Configuration for more information.

At the bottom of the php.ini file (or at least as last extension) add a reference to PHP Agent extension. The revision is not a part of the default installation path, so the version portion is 7.2 and not 7.2.0. A 64-bit Agent example for an AppMon default installation is as follows:


A 32-bit Agent example for an AppMon default installation on Windows in combination with Apache or IIS is as follows: extension="C:\Program Files\dynaTrace\dynaTrace7.2\agent\lib\dtagent.dll" php.ini

This is typically is in xampp\php for XAMPP or C:\Program Files (x86)\PHP\v<major.minorVersion> when installed with the Web Platform Installer.

The bootstrapper ( for *NIX or dtagent.dll for Windows) chooses the right PHP extension for the PHP version in use and threadsafe (_ts) or not. (dtphpagent<majorMinorPHPversion>[_ts].so or.dll)

Regardless of the PHP distribution you deploy, the Agent start always triggers in the php.ini file. The php-fpm.conf file is not supported.

  • Resort to the System Information dashboard or directly to the logs in <dynatrace install dir>/log if needed.
  • The dtphpagent section in phpinfo() contains information as well, including Agent version, status (enabled or not) and the path to the log file. See the Apache sample page in a web browser so see this information.


Reserved PHP keywords

AppMon does not support PHP reserved keywords instrumentation. See the PHP website for a complete list of keywords.

Include or require nodes in a PurePath do not refer to any PHP keywords, and have different meaning than the PHP keywords. They refer to the code in the PHP files, and not to the files. For example, if the PurePath shows the execution time for an include node, it shows how much time it took to process the code included in the files.

The only exception to this rule are the die() and exit() keywords, for which AppMon can report an exception, but only if the keyword occurs inside a function body.

Unsupported functions

  • curl_setopt: The curl_setopt function calls are suppressed to keep the PurePath size small with the PHP cURL sensor. The limitation applies also to user-defined sensor rules. See PHP documentation for information about the function.

Capture default PHP argument

AppMon does not support default PHP arguments capture.


If you use PHP accelerator extensions in your PHP deployment, like eAccelerator, it does not report compilation time.

AppMon Agent usage

If you're using AppMon Agent, don't forget to configure ports for it.

This Agent is available in both agent platforms. Please check the release status of the Agent before switching over as some Agents have BETA status in AppMon 2017 May .