Modifying PHP agent configurations
Note: This is only applicable to version 4.1 and above of the agent.
The PHP agent configurations (such as the application name, data port, and status port) can be modified using any of the following methods:
Linux
Set options using the command-line arguments
Execute the configure command along with the directive and its corresponding value:
sudo sh /opt/zpa/bin/agent_php.sh configure <directive> <value>
Example:
Execute the following command to change the default application name and disable capturing MySQL:
sudo sh /opt/zpa/bin/agent_php.sh configure -zpa.application_name "appname" -zpa.capture_mysql 0
Refer to the table given below for the list of the other options available:
| Option | Description |
| -php.install_path |
- The custom installation path of the PHP agent.
|
| -zpa.application_name |
- The name of your new application.
- The default value is PHP-Application.
|
| -zpa.additional_buffer |
- By default, the first 1,000 spans that exceed the method threshold are captured. This can be increased up to 5,000 (including the default 1,000 spans).
- The max supported value is 4,000.
- The default value is 0.
Note: Available only in PHP Agent v4.1 and below.
|
| -zpa.data_port |
- The inter-process communication (IPC) data port number.
- The default value is 20022.
|
| -zpa.status_port |
- The IPC status port number.
- The default value is 20021.
|
| -zpa.method_threshold |
- The threshold (in milliseconds) above which the method must be tracked.
- The default value is 10.
|
| -zpa.remote_exporter_ip |
- The IP Address of the device on which the data exporter is currently running.
|
| -zpa.remote_exporter_hostname |
- The hostname of the device on which the exporter is running. This be left empty if the exporter and agent are running on the same device.
- The default value is empty.
|
| -zpa.span_limit |
- The maximum number of spans to be captured (Default value: 10000).
|
| -zpa.stack_depth |
- This is the depth of stack trace to be captured.
- The default value is 15.
|
| -zpa.capture_casssandra |
- 1 is for capturing, and 0 is for disabling.
- The default value is 1.
|
| -zpa.capture_clirequest |
| -zpa.capture_distributed_trace |
| -zpa.capture_http |
| -zpa.capture_memcached |
| -zpa.capture_mssql |
| -zpa.capture_mysql |
| -zpa.capture_oracle |
| -zpa.capture_pdo |
| -zpa.capture_postgres |
| -zpa.capture_redis |
| -zpa.track_errors |
| -zpa.track_exceptions |
| -zpa.track_zend_execute_internal |
| -zpa.track_zend_execute |
Set options using environment variables
- Export the directive and its corresponding value:
export <directive>= <value>
- Execute the configure command:
sudo -E sh /opt/zpa/bin/agent_php.sh configure
Example: Execute the following commands to change the default application name and disable capturing MySQL
-
export ZPA_APPLICATION_NAME="appname"
export ZPA_CAPTURE_MYSQL=0
-
sudo -E sh /opt/zpa/bin/agent_php.sh configure
Refer to the table given below for the list of the other options available:
| Option | Description |
| PHP_INSTALL_PATH |
- The Custom Installation Path of the PHP agent.
|
| ZPA_APPLICATION_NAME |
- The name of your new application.
- The default value is PHP-Application.
|
| ZPA_ADDITIONAL_BUFFER |
- By default, the first 1,000 spans that exceed the method threshold are captured. This can be increased by up to 5,000 (including the default 1,000 spans).
- The max supported value is 4,000.
- The default value is 0.
|
| ZPA_DATA_PORT |
- The inter-process communication (IPC) data port number.
- The default value is 20022.
|
| ZPA_STATUS_PORT |
- The IPC status port number.
- The default value is 20021.
|
| ZPA_METHOD_THRESHOLD |
- The threshold (in milliseconds) above which the method must be tracked.
- The default value is 10.
|
| ZPA_REMOTE_EXPORTER_IP |
- The IP Address of the device on which the data exporter is currently running.
|
| ZPA_REMOTE_EXPORTER_HOSTNAME |
- The hostname of the device on which the exporter is running. This be left empty if the exporter and agent are running on the same device.
- The default value is empty.
|
| ZPA_SPAN_LIMIT |
- The maximum number of spans to be captured (Default value: 10000).
|
| ZPA_STACK_DEPTH |
- This is the depth of stack trace to be captured.
- The default value is 15.
|
| ZPA_CAPTURE_CASSANDRA |
- 1 is for capturing, and 0 is for disabling.
- The default value is 1.
|
| ZPA_CAPTURE_CLIREQUEST |
| ZPA_CAPTURE_DISTRIBUTED_TRACE |
| ZPA_CAPTURE_HTTP |
| ZPA_CAPTURE_MEMCACHED |
| ZPA_CAPTURE_MSSQL |
| ZPA_CAPTURE_MYSQL |
| ZPA_CAPTURE_ORACLE |
| ZPA_CAPTURE_PDO |
| ZPA_CAPTURE_POSTGRES |
| ZPA_CAPTURE_REDIS |
| ZPA_TRACK_ERRORS |
| ZPA_TRACK_EXCEPTIONS |
| ZPA_TRACK_ZEND_EXECUTE_INTERNAL |
| ZPA_TRACK_ZEND_EXECUTE |
Set options by modifying the configuration.json file
- Modify the configuration.json file.
- Execute the configure command:
sudo sh /opt/zpa/bin/agent_php.sh configure
Example: Execute the following commands to change the default application name and disable capturing MySQL
-
{
"php.install_path": "",
"PHP_agent_configuration": {
"extension": "php_zpa.dll",
"zpa.application_name" : "appname",
"zpa.capture_mysql" : 0
}
}
-
sudo sh /opt/zpa/bin/agent_php.sh configure
Refer to the table given below for the list of the other options available:
| Option | Description |
| -php.install_path |
- The custom installation path of the PHP agent.
|
| -zpa.application_name |
- The name of your new application.
- The default value is PHP-Application.
|
| -zpa.additional_buffer |
- By default, the first 1,000 spans that exceed the method threshold are captured. This can be increased up to 5,000 (including the default 1,000 spans).
- The max supported value is 4,000.
- The default value is 0.
Note: Available only in PHP Agent v4.1 and below.
|
| -zpa.data_port |
- The inter-process communication (IPC) data port number.
- The default value is 20022.
|
| -zpa.status_port |
- The IPC status port number.
- The default value is 20021.
|
| -zpa.method_threshold |
- The threshold (in milliseconds) above which the method must be tracked.
- The default value is 10.
|
| -zpa.remote_exporter_ip |
- The IP Address of the device on which the data exporter is currently running.
|
| -zpa.remote_exporter_hostname |
- The hostname of the device on which the exporter is running. This be left empty if the exporter and agent are running on the same device.
- The default value is empty.
|
| -zpa.span_limit |
- The maximum number of spans to be captured (Default value: 10000).
|
| -zpa.stack_depth |
- This is the depth of stack trace to be captured.
- The default value is 15.
|
| -zpa.capture_casssandra |
- 1 is for capturing, and 0 is for disabling.
- The default value is 1.
|
| -zpa.capture_clirequest |
| -zpa.capture_distributed_trace |
| -zpa.capture_http |
| -zpa.capture_memcached |
| -zpa.capture_mssql |
| -zpa.capture_mysql |
| -zpa.capture_oracle |
| -zpa.capture_pdo |
| -zpa.capture_postgres |
| -zpa.capture_redis |
| -zpa.track_errors |
| -zpa.track_exceptions |
| -zpa.track_zend_execute_internal |
| -zpa.track_zend_execute |
Windows
Set options by modifying the configuration.json file
- Modify the configuration.json file.
Example: To change the default application name and disable capturing MySQL execute the following command.
{
"php.install_path": "",
"PHP_agent_configuration": {
"extension": "php_zpa.dll",
"zpa.application_name" : "appname",
"zpa.capture_mysql" : 0
}
}
- Double-click the MSI file, select Repair APM Insight PHP Agent, and click Finish.

Refer to the table given below for the list of the other options available:
| Option | Description |
| -php.install_path |
- The custom installation path of the PHP agent.
|
| -zpa.application_name |
- The name of your new application.
- The default value is PHP-Application.
|
| -zpa.additional_buffer |
- By default, the first 1,000 spans that exceed the method threshold are captured. This can be increased up to 5,000 (including the default 1,000 spans).
- The max supported value is 4,000.
- The default value is 0.
Note: Available only in PHP Agent v4.1 and below.
|
| -zpa.data_port |
- The inter-process communication (IPC) data port number.
- The default value is 20022.
|
| -zpa.status_port |
- The IPC status port number.
- The default value is 20021.
|
| -zpa.method_threshold |
- The threshold (in milliseconds) above which the method must be tracked.
- The default value is 10.
|
| -zpa.remote_exporter_ip |
- The IP Address of the device on which the data exporter is currently running.
|
| -zpa.remote_exporter_hostname |
- The hostname of the device on which the exporter is running. This be left empty if the exporter and agent are running on the same device.
- The default value is empty.
|
| -zpa.span_limit |
- The maximum number of spans to be captured (Default value: 10000).
|
| -zpa.stack_depth |
- This is the depth of stack trace to be captured.
- The default value is 15.
|
| -zpa.capture_casssandra |
- 1 is for capturing, and 0 is for disabling.
- The default value is 1.
|
| -zpa.capture_clirequest |
| -zpa.capture_distributed_trace |
| -zpa.capture_http |
| -zpa.capture_memcached |
| -zpa.capture_mssql |
| -zpa.capture_mysql |
| -zpa.capture_oracle |
| -zpa.capture_pdo |
| -zpa.capture_postgres |
| -zpa.capture_redis |
| -zpa.track_errors |
| -zpa.track_exceptions |
| -zpa.track_zend_execute_internal |
| -zpa.track_zend_execute |
Thank you for your feedback!