Install PHP Agent for Linux (PHP version 7.0 and above)
Prerequisites
- PHP version 7.0 or above is required.
If you use a PHP version below 7.0, kindly follow these steps to install the agent.
- If you are using a PHP agent version below 4.0, kindly follow these steps to uninstall the older agent before the installation.
- Install S247DataExporter (for Linux or Windows) to allow the PHP agent to communicate with Site24x7.
S247DataExporter is mandatory for PHP application monitoring.
Installation instructions
The PHP agent can be installed using any of the following methods:
Set options using the command-line interface
- Download the installation script.
wget -O InstallAgentPHP.sh https://staticdownloads.site24x7.com/apminsight/agents/AgentPHP/linux/InstallAgentPHP.sh
- Execute the installation command with the required options.
sudo sh InstallAgentPHP.sh -lk "licensekey"
or
sudo sh InstallAgentPHP.sh -license.key "licensekey" - Restart your web server and the FastCGI Process Manager (FPM).
The list of other available options is given below:
Option |
Description |
-lk, -license.key |
Your account license key |
-zpa.application_name |
Your application name Note: The default name is PHP-Application. |
-zpa.status_port |
The inter-process communication status port number |
-zpa.data_port |
The inter-process communication data port number |
-zpa.remote_exporter_hostname |
The hostname of the device on which the exporter is running |
Set options using environment variables
- Download the installation script.
wget -O InstallAgentPHP.sh https://staticdownloads.site24x7.com/apminsight/agents/AgentPHP/linux/InstallAgentPHP.sh
- Set the required options.
export S247_LICENSE_KEY="licensekey"
- Execute the installation command.
sudo -E sh InstallDataExporter.sh
- Restart your web server and the FastCGI Process Manager (FPM).
The list of other available install options is given below:
Option |
Description |
S247_LICENSE_KEY |
Your account license key |
ZPA_APPLICATION_NAME |
Your application name Note: The default name is PHP-Application. |
ZPA_STATUS_PORT |
The inter-process communication status port number |
ZPA_DATA_PORT |
The inter-process communication data port number |
ZPA_REMOTE_EXPORTER_HOSTNAME |
The hostname of the device on which the exporter is running |
Related article
Troubleshooting steps if you don't see any data after installing the PHP agent