Installing the PHP Agent
These steps describe how to install the PHP Agent with the installation script, install.sh
- Verify support and system requirements for your environment as described in Install the PHP Agent.
-
Create the
php-agent
installation directory.The directory should be owned by the same user that runs Apache or PHP-FPM (FastCGI Process Manager). Splunk AppDynamics recommends naming the directory/opt/appdynamics/php-agent.
Note: This document refers to the PHP Agent installation directory as: The directory should be owned by the same user that runs Apache or PHP-FPM (FastCGI Process Manager). Splunk AppDynamics recommends naming the directory/opt/appdynamics/php-agent
. -
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, andphp_ext
dir options.See:From the command line, change directories to the PHP agent installation directory and extract the agent distribution. Here are sample commands:
Option Description Linux cd <php_agent_install> tar -xvjf appdynamics-php-agent-x64-linux.tar.bz2
Windows Expand-Archive -Path "C:\path\to\your\zipfile.zip" -DestinationPath "C:\path\to\extract\to"
-
Set the following permissions on your
<php_agent_install>
directory.-
php
: Make every directory that leads to the PHP agent logs directory readable and executable by all and writable by the directory owner:chmod -R 755 <php_agent_install>
-
logs
: If possible, make the logs subdirectory readable/writable/executable by all:chmod 777 <php_agent_install>/logs
Directory access permissions of 777 may be too permissive for some organizations. In this case, simply make sure that the directory is owned by the
apache
/php
/proxy
user.
-
-
Run the installation script using the following syntax:
Note: For Windows, make sure that you have the administrator access.
The command arguments are described as follows:
-s
option: You can optionally specify the-s
option if you want the agent to use SSL (HTTPS) to connect to the controller. In this case, set the Controller port to the HTTPS port of the controller.-a account_name@account_access_key
: The required controller account name and account key. To find your account name and access key, clickin the upper right corner of the Splunk AppDynamics UI, then click License.
http-proxy-host
andhttp-proxy-port
: Set the<http-proxy-host>
and<
http-proxy-port>
to route data to the controller through a proxy server. The<http-proxy-host>
is the hostname or IP address of the proxy server. The<http-proxy-port>
is the proxy server HTTP or HTTPS port, whichever you are using. If you set thehttp-proxy-host
you must set thehttp-proxy-port
as well.http-proxy-user
,http-proxy-password-file:
The username and password file if using a proxy and the proxy server requires credentials.-e
option: Extensions directory for theappdynamics_agent.so
file. Needed on Ubuntu as well as when the default PHP CLI binary cannot be determined.-i
option:ini
directory for theappdynamics_agent.ini
file. Needed on Ubuntu as well as when the default PHP CLI binary cannot be determined.-v
option: version of PHP that you are instrumenting. Valid formats are version numbers to one or two decimal positions, for example,7.4
and7.4.29
. Needed only when the default PHP CLI binary cannot be determined or there is no PHP CLI binary.-p
option: path to the PHP binaryenable-cli-long-running
: Set totrue
to defend PHP in long-running CLI applications. Defaults tofalse.
See Long-Running CLI Applications with the Suhosin Patch.--log-dir=<dir>
: The directory to which the agent and proxy logs should be written. Defaults to the<php_agent_install>/logs
directory.--proxy-ctrl-dir=<dir>
: The proxy control directory. If not specified, the installer creates a temporary directory.
If all options are used, the
-e
,-i
and-v
options have precedence over the -p option.Note: 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 the appdynamics_agent.ini file. - 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 thephp.ini
file. - Restart the webserver, unless you are installing an agent to monitor PHP-CLI only.