This page provides an overview of Splunk AppDynamics PHP Agent installation. 

Installation Overview

In the Controller UI, the Getting Started Wizard walks you through the configuration and installation steps for the PHP Agent.

The installer that you get from the wizard uses the PHP directory specified in your environment PATH variable to determine where to install the agent. If you are instrumenting a PHP installation not specified in your PATH, you can manually configure and invoke the RPM or script installer. 

The PHP Agent runs on Linux and MacOS machines. The PHP Agent is designed for PHP operating environments in which:

  • There is a single PHP installation
  • PHP is running in a single Apache or FPM pool
  • Standard packages have been used to install PHP, Apache and/or PHP-FPM
  • No customizations have been made to the PHP configuration

The PHP Agent may work in environments that do not meet all assumptions. However, you should use extra care in installing and thoroughly testing the PHP agent and application in a staging environment. 

Before You Begin

Before attempting to install the PHP Agent:

  • Confirm that you use a supported PHP version. You can check your PHP version using this command:
    php -i
    CODE
  • The PHP Agent does not work with PHP applications that are built with the enable-debug configuration option or in any build otherwise compiled with debugging symbols. To determine whether the application was built with debugging symbols, you can use this command:
    php -i | grep -e "Debug Build"
    CODE

The response should be:

Debug Build => no
CODE
  • You can get the PHP Agent distribution from the Cisco AppDynamics Download Portal. Be sure to get the distribution file appropriate for your system:
    • For RedHat or CentOS, use the RPM Package Manager distribution, such as PHP Agent—64-bit RPM
    • For MacOS, use PHP Agent—64-bit OSX
    • For Alpine Linux, use PHP Agent Alpine Linux - 64-bit

    • For Windows Server 2019, use the distribution identified PHP Agent—64-bit Windows
    • For all other Linux distributions, use the distribution identified PHP Agent—64-bit Linux
  • At installation time, provide Controller connection settings and identifying information for this PHP node. The Getting Started Wizard walks you through this configuration, so if it is your first time installing an Splunk AppDynamics Agent, we recommend using the Getting Started Wizard. For general information about the Controller connection settings, see Agent-to-Controller Connections.
  • To complete the instrumentation, stop and start the Apache Server. Ensure that you perform the installation in a way that minimizes disruption to service users, if applicable. 

    Do not install the PHP Agent along with other non-Splunk AppDynamics Application Performance Management (APM) tools, especially in a production environment. The PHP Agent installation may fail if there are other APM products installed in the same managed environment.

  • (For Alpine Linux) Before you install the PHP Agent:

    1. Add the libstdc++ library:
      apk add libstdc++
      CODE
    2. Add the session and sockets PHP extensions:

      For example, if you are using PHP 8.2, then install the php82-session and php82-sockets extensions:

      apk add php82-session php82-sockets
      CODE

Installing the PHP Agent

These topics provide installation details for various scenarios:

For cURL installation, see Download Splunk AppDynamics Software.

Files Added by Installation

PHP configuration files

For Splunk AppDynamics, the PHP configuration files of interest are the php.ini and appdynamics_agent.ini fragment. Splunk AppDynamics settings can be found in either .ini file, depending on the operating system under which your PHP is installed.

The PHP Agent installer adds the appdynamics_agent.ini file to the directory that contains your php.ini file. You can find this directory using the following command:

php -i | grep -e "Additional .ini files parsed"

If the installer is not able to determine the directory where the ini fragments for your PHP deployment live, it displays the required Splunk AppDynamics ini fragment and prompts you to copy and paste it into your main php.ini file.

Also, see http://php.net/manual/en/configuration.file.php for information about possible locations.

.so and .dll files

The installer also installs the following file in your PHP extensions directory.

  • For Linux: appdynamics_agent.so
  • For Windows: appdynamics_agent.dll
php -i | grep  extension_dir

Logs

There is an agent log and a proxy log for each application.

By default, the agent log is written to $<php_agent_install>/logs/agent.log. The log contains the transactions that the agent processes and then sends to the proxy. The default pattern for agent log naming is:

  • agent.log: the current log
  • agent.log.1: most recent log
  • agent.log.2: second most recent log
  • agent.log.3: third most recent log
  • agent.log.4: fourth most recent log
  • agent.log.5: fifth recent log

By default, the proxy log is written to $<php_agent_install>/logs/proxy_$date.log. This log contains the transactions that the proxy accepts from the agent and then sends to the Controller.

If you configure the logs directory with the --log-dir option, the proxy logs are written to the same directory as the agent logs.

For information about the location of log files generated by an RPM installation, see RPM Log file in Install the PHP Agent by RPM.

Using a Machine Agent on a PHP Node

You can install a machine agent on a node that runs the PHP Agent. However, note that if you install the machine agent on a PHP Agent node and you specify the tier and node name in the controller-info.xml file of the machine agent, the PHP Agent will not successfully register with the Controller.

To avoid this problem:

  • Install the PHP Agent before you install the machine agent
  • If you install the machine agent on the machine hosting the instrumented PHP node, do not specify the application, tier or node name in the controller-info.xml file of the machine agent. If you do, the PHP Agent may fail to register.