Help Docs

Modifying the PHP agent configurations

  • This is only applicable to version 4.1 and above of the agent.
  • If you want to modify the configurations for each PHP application separately, check out this help page.

The PHP agent configurations (such as the application name, data port, and status port) can be modified for all of the applications on the application server.

Linux

Set options using 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

Please check the table below for the list of the other available options:

Option Description
-zpa.application_name
  • This is your new application name. 
  • 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.
-zpa.data_port
  • This is the inter-process communication (IPC) data port number. 
  • The default value is 20022.
-zpa.status_port
  • This is the IPC status port number. 
  • The default value is 20021.
-zpa.hostlicense_apply
-zpa.method_threshold
  • This is the threshold (in milliseconds) above which the method must be tracked. 
  • The default value is 10.
-zpa.remote_exporter_hostname
  • This is the hostname of the device on which the exporter is running. It can also be left empty if the exporter and agent are running on the same device.
  • The default value is empty.

-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 environmental variables

  1. Export the directive and its corresponding value:
    export <directive>=<value>
  2. 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:

Step 1

export ZPA_APPLICATION_NAME="appname"
export ZPA_CAPTURE_MYSQL=0

Step 2

sudo -E sh /opt/zpa/bin/agent_php.sh configure

Please check the table below for the list of the other available options:

Option Description

ZPA_APPLICATION_NAME

  • This is your new application name. 
  • 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.

ZPA_DATA_PORT

  • This is the inter-process communication (IPC) data port number. 
  • The default value is 20022.

ZPA_STATUS_PORT

  • This is the IPC status port number. 
  • The default value is 20021.

ZPA_HOSTLICENSE_APPLY

ZPA_METHOD_THRESHOLD

  • This is the threshold (in milliseconds) above which the method must be tracked. 
  • The default value is 10.

ZPA_REMOTE_EXPORTER_HOSTNAME

  • This is the hostname of the device on which the exporter is running. It can also be left empty if the exporter and agent are running on the same device.
  • The default value is empty.

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

  1. Modify the configuration.json file.
  2. 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:

Step 1

{
   "PHP_installation_path": "",
   "PHP_agent_configuration": {
      "extension": "php_zpa.dll",
      "zpa.application_name" : "appname",
      "zpa.capture_mysql" : 0
   }
}

Step 2

sudo sh /opt/zpa/bin/agent_php.sh configure

Please check the table below for the list of the other available options:

Option Description

zpa.application_name

  • This is your new application name. 
  • 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.

zpa.data_port

  • This is the inter-process communication (IPC) data port number. 
  • The default value is 20022.

zpa.status_port

  • This is the IPC status port number. 
  • The default value is 20021.

zpa.hostlicense_apply

zpa.method_threshold

  • This is the threshold (in milliseconds) above which the method must be tracked. 
  • The default value is 10.

zpa.remote_exporter_hostname

  • This is the hostname of the device on which the exporter is running. It can also be left empty if the exporter and agent are running on the same device.
  • The default value is empty.

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

  1. 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
       }
    }
  2. Double-click the MSI file, select Repair APM Insight PHP Agent, and click Finish.

Please check the table below for the list of the other available options:

Option Description

zpa.application_name

  • This is your new application name. 
  • 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.

zpa.data_port

  • This is the inter-process communication (IPC) data port number. 
  • The default value is 20022.

zpa.status_port

  • This is the IPC status port number. 
  • The default value is 20021.

zpa.hostlicense_apply

zpa.method_threshold

  • This is the threshold (in milliseconds) above which the method must be tracked. 
  • The default value is 10.

zpa.remote_exporter_hostname

  • This is the hostname of the device on which the exporter is running. It can also be left empty if the exporter and agent are running on the same device.
  • The default value is empty.

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

Was this document helpful?

Shortlink has been copied!