After you install the Application Real-Time Monitoring Service (ARMS) agent for a PHP application, ARMS starts to monitor the PHP application. You can view the monitoring data of the PHP application, such as the application topology, traces, abnormal transactions, slow transactions, and SQL analysis. The performance of the latest ARMS agent is optimized. The CPU and memory usage of the ARMS agent is reduced to around 5%.

Notice The PHP application monitoring feature is under maintenance. You cannot obtain the ARMS agent for PHP from the ARMS console. If you want to use ARMS to monitor PHP applications, you can join the DingTalk Q&A group for PHP application monitoring (group ID: 23328286) to learn how to add PHP applications for monitoring.
  1. Run the wget command to download the installation package. Download the installation package based on your region.
    Region Download link for the Internet Download link for VPC
    China (Hangzhou)
    wget "http://arms-apm-hangzhou.oss-cn-hangzhou.aliyuncs.com/arms-php-agent.zip" -O arms-php-agent.zip
    wget "http://arms-apm-hangzhou.oss-cn-hangzhou-internal.aliyuncs.com/arms-php-agent.zip" -O arms-php-agent.zip
    China (Shanghai)
    wget "http://arms-apm-shanghai.oss-cn-shanghai.aliyuncs.com/arms-php-agent.zip" -O arms-php-agent.zip
    wget "http://arms-apm-shanghai.oss-cn-shanghai-internal.aliyuncs.com/arms-php-agent.zip" -O arms-php-agent.zip
    China (Qingdao)
    wget "http://arms-apm-qingdao.oss-cn-qingdao.aliyuncs.com/arms-php-agent.zip" -O arms-php-agent.zip
    wget "http://arms-apm-qingdao.oss-cn-qingdao-internal.aliyuncs.com/arms-php-agent.zip" -O arms-php-agent.zip
    China (Beijing)
    wget "http://arms-apm-beijing.oss-cn-beijing.aliyuncs.com/arms-php-agent.zip" -O arms-php-agent.zip
    wget "http://arms-apm-beijing.oss-cn-beijing-internal.aliyuncs.com/arms-php-agent.zip" -O arms-php-agent.zip
    China (Zhangjiakou)
    wget "http://arms-apm-zhangjiakou.oss-cn-zhangjiakou.aliyuncs.com/arms-php-agent.zip" -O arms-php-agent.zip
    wget "http://arms-apm-zhangjiakou.oss-cn-zhangjiakou-internal.aliyuncs.com/arms-php-agent.zip" -O arms-php-agent.zip
    China (Shenzhen)
    wget "http://arms-apm-shenzhen.oss-cn-shenzhen.aliyuncs.com/arms-php-agent.zip" -O arms-php-agent.zip
    wget "http://arms-apm-shenzhen.oss-cn-shenzhen-internal.aliyuncs.com/arms-php-agent.zip" -O arms-php-agent.zip
    China (Hong Kong)
    wget "http://arms-apm-hongkong.oss-cn-hongkong.aliyuncs.com/arms-php-agent.zip" -O arms-php-agent.zip
    wget "http://arms-apm-hongkong.oss-cn-hongkong-internal.aliyuncs.com/arms-php-agent.zip" -O arms-php-agent.zip
  2. Run the following command to decompress the installation package and move it to the /usr/local/arms/arms-php-agent directory:
    unzip arms-php-agent.zip
    mkdir -p /usr/local/arms
    mv arms-php-agent /usr/local/arms/arms-php-agent
  3. Log on to the ARMS console.
  4. In the left-side navigation pane, choose Application Monitoring > Applications. In the top navigation bar, select a region.
  5. On the Applications page, click Add Application in the upper-right corner.
  6. Copy the license key at the top of the Add Application page.
  7. Add the following code to the php.ini configuration file.
    extension=/usr/local/arms/arms-php-agent/arms-x.x.so
    [ARMS]
    arms.enable=1
    arms.app_name=<yourAppName>
    arms.license_key=<yourLicenseKey>
    arms.sock_path=/arms.sock
    Note
    • x.x in arms-x.x.so is the version of your PHP application. Versions 5.4 to 7.3 are supported.
    • Set <yourAppName> to a custom name. The name is displayed as your PHP application name in the ARMS console.
    • Replace <yourLicenseKey> with the license key that you obtained in Step 6.
    • If with-config-file-scan-dir is configured for the version of your PHP application, you can create the arms.ini file in the /etc/php/7.2/php-fpm/conf.d directory. The content of this file is the same as that you added to the php.ini file.
  8. Run the following command to start the Hercules service to report the data of your PHP application:
    cd /usr/local/arms/arms-php-agent/
    sudo ./hercules service install
    sudo ./hercules service start
  9. Restart the service.
    • If you are using an NGINX server, restart the PHP-FPM service.
    • If you are using an Apache server, restart the Apache2 service.
    Wait for about 1 minute. In the ARMS console, choose Application Monitoring > Applications. If your application is displayed with the name of custom <yourAppName>, the probe is installed.

Uninstall the ARMS agent

  1. Delete the content that you added to the php.ini file in Step 7 or delete the arms.ini file.
  2. Restart the service.
    • If you are using an NGINX server, restart the PHP-FPM service.
    • If you are using an Apache server, restart the Apache2 service.
  3. Run the following commands to stop and uninstall the Hercules service:
    sudo ./hercules service stop
    sudo ./hercules service uninstall
  4. Run the following command to delete the directory of the ARMS agent:
    sudo rm -rf /usr/local/arms/arms-php-agent
    You have uninstalled the ARMS agent for the PHP application.