Download PDF
Download page Install the PHP Agent by RPM.
Install the PHP Agent by RPM
You can use the AppDynamics PHP Agent RPM to install the PHP Agent on RedHat or CentOS Linux systems.
About the RPM Installer
You must use the PHP Agent RPM installer as the root user.
You pass configuration settings for the agent to the installer using environment variables rather than command-line arguments. Before starting—or as part of your installation script—you need to set the environment variables. You can configure settings such as node name, tier name, business application name, and others for the agent. However, the installer will provide sensible defaults if not provided.
The RPM installer determines the location of your PHP installation based on the PATH environment variable. It uses the first PHP installation that it encounters in the PATH to configure the installer. If you have installed PHP in a non-standard location, you must provide the directory of your PHP binary in the APPD_PHP_PATH
environment variable.
Before starting, get the RPM package from the AppDynamics Download Portal.
Installing the PHP Agent with RPM
To install PHP Agent with RPM:
Verify support and system requirements for your environment as described in Install the PHP Agent.
- Set environment variables with the configuration settings for the agent if needed. The account key is a required setting. Other settings may be required depending on your environment. See RPM Environment Variables for more information. Alternatively, you can pass environment variables to the installation script directly.
Run the installer.
sudo rpm -i <package_name>
Replace
<package_name>
with the name of the package you downloaded.If you are using
sudo
to pass the environment variables to the installation script you can use:sudo APPD_PHP_PATH=/opt/php rpm -i <package_name>
or
APPD_PHP_PATH=/opt/php sudo -E rpm -i <package_name>
If the install reports errors, check the log file as described in RPM Log File.
- Restart Apache. Not required if you are installing an agent to monitor PHP CLI only.
The RPM installs a single agent. If you have more than one PHP installation on the machine, run the RPM once for each PHP installation, each time with the appropriate APPD_PHP_PATH
and APPD_CONF_NODE
settings.
RPM Environment Variables
Environment Variable | Description | Default | Required? |
---|---|---|---|
| Directory containing the PHP binary | None | If your PHP binary is not in a standard location. By default, the installer uses the PHP CLI binary to determine where to install the app agent. |
APPD_PHP_CONFIGURATION_DIR | INI directory in which to install the appdynamics_agent.ini file. Takes precedence over the APPD_PHP_PATH setting. | Directory containing your php.ini file. See information on files added to your installation in Install the PHP Agent. | If your PHP binary is not in the standard location or if no PHP CLI binary is available. |
APPD_PHP_EXTENSION_DIR | Extensions directory in which to install the appdynamics_agent.so file. Takes precedence over the APPD_PHP_PATH setting. | Your PHP extensions directory. See information on files added to your installation in Install the PHP Agent. | If your PHP binary is not in the standard location or if no PHP CLI binary is available. |
APPD_PHP_VERSION | Version of PHP that you are instrumenting. Valid formats are version numbers to one or two decimal positions, for example, 7.4 and 7.4.29 are both valid. Takes precedence over the APPD_PHP_PATH setting. | Version used by your PHP CLI binary | If no PHP CLI binary is available, along with the APPD_PHP_CONFIGURATION_DIR and APPD_PHP_EXTENSION_DIR variables. |
| Controller hostname |
| |
| Controller port |
| |
| Application name |
| |
| Tier name | Hostname of the machine running the script—same as the node name | |
| Node name | Hostname of the machine running the script | |
| Account name | Defaults to | If you have an on-premises AppDynamics Controller running in multi-tenant mode or if you are using the AppDynamics SaaS Controller. |
| Account key | None | Yes. |
|
|
| |
| Hostname or IP address of the http proxy server | None | If you want to route data to the controller through a proxy server. |
| HTTP or HTTPS port of the http proxy server; must be set if | None | If you want to route data to the controller through a proxy server. |
APPD_CONF_HTTP_PROXY_USER | Username on the http proxy server | None | If you want to route data to the controller through a proxy server that requires a username. |
APPD_CONF_HTTP_PROXY_PASSWORD_FILE | Password on the http proxy server | None | You want to route data to the controller through a proxy server that requires a password. |
APPD_PROXY_CTRL_DIR | Initial control communication directory between the agent and the Java proxy | None | |
APPD_CONF_LOG_DIR | Directory to which the agent writes the agent and proxy logs | <php_agent_install>/logs | |
APPD_CONF_CLI_LONG_RUNNING_ENABLED | Defends PHP in long-running CLI applications. | false | Advisable if instrumenting long-running CLI applications. See Long-Running CLI Applications with the Suhosin Patch in Configure the Agent for PHP CLI Applications. |
Updating the Installation
Any changes that you made to the configuration files are preserved when you re-run the installer. RPM saves your original settings and appdynamics_agent_log4cxx.xml
files with the settings from the previous installation.
RPM Installation Log File
If errors occurred during installation, a message displays the location of the log file generated in the /tmp
directory. Examine this log file to identify the cause of the problem. A successful installation does not produce a log file.
Uninstall the PHP Agent using RPM
If you installed the agent using RPM, use RPM to uninstall it, as follows:
sudo rpm -e appdynamics-php-agent-<version>
Notice that you need to identify the version of the package. To find the version of the package that you installed, you can enter:
rpm -qa | grep appdynamics-php-agent
The existing configurations are saved in a tar file in /tmp
, as indicated upon completion of the uninstall process.