Installing APM Insight PHP Agent


Install PHP Agent in Linux

To install APM Insight PHP agent in Applications Manager, follow the below given instructions:

  1. Start by logging into root.
  2. Extract the agent_php.zip file into /opt directory. This will create a sub-directory called zpa.
    $ cd /opt
    $ wget [agent_php.zip LINK]
    $ unzip agent_php.zip
  3. Navigate to zpa/bin directory and execute the command:
    $ cd zpa/bin
    $ sudo sh configure.sh [ENTER LICENSE KEY HERE]

    Note: You can find your license key in the APM Insight tab after logging into Applications Manager.

  4. Open the apminsight.conf file available in the zpa/conf directory and include the following keys:
    apm.host=[HOST-NAME]
    apm.port=[HOST-PORT]
    use.https=[true/false]

    Example:

    apm.host=app-w8-test
    apm.port=9121
    use.https=false

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

  5. Restart your PHP agent using the following command:
    $ sh run.sh restart
  6. 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.

 

Note:

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 run.sh start

#Stop the agent
$ sh run.sh stop

#Restart the agent
$ sh run.sh restart

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

Install PHP Agent in Windows

To install APM Insight PHP agent in Applications Manager, follow the below given instructions:

  1. Log into your Applications Manager account and go to APM Insight tab.
  2. Copy the License key displayed in the APM Insight tab.
  3. Download the PHP agent msi file from the APM Insight agent download page.
  4. Start the installer and follow the steps given in the installation wizard.
  5. Enter the copied License key (displayed in the APM Insight tab) when prompted and proceed with the installation.
  6. After installation is complete, open the apminsight.conf file available in the \APM Insight PHP Agent\zpa\conf directory and include the following keys:
    apm.host=[HOST-NAME]
    apm.port=[HOST-PORT]
    use.https=[true/false]

    Example:

    apm.host=app-w8-test
    apm.port=9121
    use.https=false

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

  7. Execute an iisreset command manually after implementing the above changes.
  8. Generate traffic on the server and check the data collected in the APM Insight console.