Related pages:

This page describes how to install the PHP Agent using the included installation script:

Installing the PHP Agent

These steps describe how to install the PHP Agent with the installation script, install.sh.

  1. Verify support and system requirements for your environment as described in Install the PHP Agent

  2. Create the php-agent installation directory. The directory should be owned by the same user that runs Apache or PHP-FPM (FastCGI Process Manager). recommends naming the directory /opt/appdynamics/php-agent.

    This document refers to the PHP Agent installation directory as: <php_agent_install>. Replace the <php_agent_install> syntax with the full path to your agent installation directory. For example, change <php_agent_install> to /opt/appdynamics/php-agent

  3. If there is more than one Apache instance on a machine, run install.sh once for each Apache instance, each time with the appropriate node, php_ini dir and php_ext dir options. 

    See Run the PHP Proxy Daemon Manually 

    See Files Added to Your Installation 

    From the command line, change directories to the PHP agent installation directory and extract the agent distribution. Here are sample commands:

    cd <php_agent_install>
    tar -xvjf appdynamics-php-agent-x64-linux.tar.bz2
    
    Expand-Archive -Path "C:\path\to\your\zipfile.zip" -DestinationPath "C:\path\to\extract\to"
    


  4. Set the following permissions on your <php_agent_install> directory.

  5. Run the installation script using the following syntax:

    For Windows, make sure that you have the administrator access.

    <php_agent_install>/install.sh  [-s] -a=<account_name>@<account_access_key>
    [--http-proxy-host=<proxy_host>] [--http-proxy-port=<proxy_port>] [-e <php_ext_dir>] [-i <php_ini_dir>]
    [-p <php_binary_dir>] [-v <php_version>]
     <controller-host> <controller-port> <app_name> <tier_name> <node_name>
    
    <php_agent_install>/install.ps1  [-s] -a=<account_name>@<account_access_key>
    [--http-proxy-host=<proxy_host>] [--http-proxy-port=<proxy_port>] [-e <php_ext_dir>] [-i <php_ini_dir>]
    [-p <php_binary_dir>] [-v <php_version>]
     <controller-host> <controller-port> <app_name> <tier_name> <node_name>
    

    The command arguments are described as follows:  

    If all options are used, the  -e-i and -v options have precedence over the -p option.

    On Ubuntu, the installation needs to be performed as the root user. Also, you need to use the -e option to indicate the correct extensions directory for the appdynamics_agent.so file and the -i option for the correct ini directory for thappdynamics_agent.ini file.

     

  6. (Optional, for Windows only) Make sure that you copy the agent configuration fragment from the ${AGENT_DIRECTORY}/php/conf/appdynamics_agent.ini file and paste it in the php.ini file.
  7. Restart the webserver, unless you are installing an agent to monitor PHP-CLI only. 

If your installation failed, see Resolve PHP Agent Installation Issues.

Installation Command Samples

The following illustrates a sample command to install the agent:

install.sh controller 8090 -a=PHPCust@XC6v2n8m2$543 myApp myTier myNode

To install the agent using SSL, use the -s switch, as follows:

install.sh -s -a=PHPCust@XC6v2n8m2$543 controller1.appdynamics.com 8818 myApp myTier myNode

The following sample command illustrates installation with a proxy server present:

install.sh --http-proxy-host=myproxyhost --http-proxy-port=8099 -a=PHPCust@XC6v2n8m2$543 controller 8090 myApp myTier myNode