Installing APM Insight PHP Agent in Linux

To install APM Insight PHP agent in Linux operating system, follow the below given instructions:

Instructions for installation using script

  1. In Applications Manager web client, go to APM Insight tab and copy the License Key present in the helpcard.
  2. Download the APM Insight PHP Agent agent Linux file ( from the download page to the required Linux server.
  3. Start by logging into root.
  4. Extract the file into /opt directory. This will create a sub-directory called zpa.

    $ cd /opt
    $ wget [ LINK]
    $ unzip

  5. Navigate to zpa/bin directory and execute the command:

    $ cd zpa/bin
    $ sudo sh [ENTER LICENSE KEY HERE]

  6. Open the apminsight.conf file available in the zpa/conf directory and include the following keys:

    For PHP agent versions below 2.9.3:[HOST-NAME]

    For PHP agent versions 2.9.3 and above:[HOST-NAME]


    For PHP agent versions below 2.9.3:

    For PHP agent versions 2.9.3 and above:

    After including the required keys, save and close the file.

  7. Restart your PHP agent using the following command:

    $ sh restart

  8. Restart your web server / FPM server using the following commands:

    #For Apache servers,
    $ sudo service apache2 restart

    #For FPM servers,
    $ sudo service php-fpm restart

How to verify if the installation is successful:

After the installation, go to the terminal and execute the following command:

$ php -m | grep zpa

The output should contain zpa.


The agent does not restart automatically during server reboots. To start, stop or restart the agent, use the following commands:

$ cd /opt/zpa/bin

#Start the agent
$ sh start

#Stop the agent
$ sh stop

#Restart the agent
$ sh restart

#For systemd supported OS, use the following command to restart:
$ service zpdpsvc restart

Automatically restart agent during service reboots

To automatically restart APM Insight PHP agent during system reboots, use the below given steps:

For systemd servers:

The agent will automatically start during server reboots for systemd supported Linux flavors.

For non systemd servers:

  1. Edit the /etc/rc.local file
  2. Add the following lines to the rc.local:

    cd /opt/zpa/bin
    sh restart

    and save that file