Issue: After installing the APM Insight PHP Agent, multiple monitor instances appear for the same application with different port numbers (e.g., 0, 80, 443), even though the application is expected to run only on a specific port such as 80 or 443.
Issue Cause:
As per the PHP agent’s auto-discovery behavior, all application runtime ports are detected by design, resulting in monitor instances such as:
- apphost:0 (PHP-Application): Instance created to show background application activity.
- apphost:80 (PHP-Application): Instance created to show web activity accessed via port 80.
- apphost:443 (PHP-Application): Instance created to show web activity accessed via port 443
Solution: From PHP Agent v4.8.1, can configure the agent to monitor only specific ports (e.g. 443) and exclude others:
1. Identify the primary web port: Confirm the main port(s) your PHP application uses for web traffic (e.g., 443).
2. Configure included ports:
- For Windows:
- Set "zpa.include_ports" option by modifying the configuration.json file.
- e.g.
- { ... "zpa.include_ports" : "443", ... }
- { ... "zpa.include_ports" : "443,80", ... }
- Set "zpa.include_ports" option for each individual application's
- e.g. Using .user.ini file
- zpa.include_ports="443"
- zpa.include_ports="443,80"
- For Linux:
- Set "zpa.include_ports" options using the command-line arguments
- e.g.
- sh /opt/zpa/bin/agent_php.sh configure -zpa.include_ports "443"
- sh /opt/zpa/bin/agent_php.sh configure -zpa.include_ports "443,80"
- Set "zpa.include_ports" options using environment variables
- e.g.
- export ZPA_INCLUDE_PORTS="443"
- export ZPA_INCLUDE_PORTS="443,80"
- Set "zpa.include_ports" options by modifying the configuration.json file
- e.g.
- { ... "zpa.include_ports" : "443", ... }
- { ... "zpa.include_ports" : "443,80", ... }
- Set "zpa.include_ports" option for each individual application's
- e.g.
- For Apache: php_value zpa.include_ports "443"
- For Nginx: fastcgi_param PHP_VALUE "zpa.include_ports=443"
- For PHP-FPM using .user.ini file: zpa.include_ports="443"
- For Command Line Interface: php -d zpa. include_ports="443" /path/to/your/script
3. Restart the application: Restart your PHP application or your web server and the FastCGI Process Manager (FPM), if used to apply the updated configuration.
4. Remove unwanted monitors: In the Applications Manager UI, delete the monitors associated with ports that are no longer included.
Note: Ports not listed in the include_ports setting will no longer collect data. So, Kindly ensure the correct ports before applying changes.If any concerns, kindly contact appmanager-support@manageengine.com for further assistance.