Modifying the PHP agent configurations for individual applications


The configuration settings of the PHP agent, including the application name, data port, and status port, can be individually modified for each application.

Note: For instructions on modifying the configurations for all applications on the application server, please refer to this help page.

Table of contents

Linux

For Apache

Add the following key to the .htaccess file present in your application directory:

php_value <directive> <value>

Note: If the .htaccess file does not exist, create the file in your application directory, and ensure that it is allowed to override directives by modifying the server configuration.

Example:

To disable error tracking and modify the method tracking threshold, please use the key below:

php_value zpa.track_errors 0
php_value zpa.method_threshold 5

For Nginx

Add the following key within the relevant location block or server block in the application's Nginx configuration file:

fastcgi_param PHP_VALUE "<directive>=<value>";

Example:

To disable error tracking and modify the method tracking threshold, please use the key below:

fastcgi_param PHP_VALUE "zpa.track_errors=0";
fastcgi_param PHP_VALUE "zpa.method_threshold=5";

Note: Please keep in mind that modifying PHP configuration via fastcgi_param may fail if Nginx and PHP-FPM are running in different containers. In such cases, you must modify the PHP-FPM configuration directly.

For PHP-FPM

Add the following key to the .user.ini file present in your application directory. If it does not exist, create the .user.ini file in the application directory.

<directive>=<value>

Example:

To disable error tracking and modify the method tracking threshold, please use the key below:

zpa.track_errors=0
zpa.method_threshold=5

For Command Line Interface

Add the following key while executing your PHP script from the terminal:

php -d <directive>=<value> /path/to/your/script

Example:

To disable error tracking and modify the method tracking threshold, please use the key below:

php -d zpa.track_errors=0 -d zpa.method_threshold=5 /path/to/your/script

Windows

Add the following configuration to the .user.ini file in the website's root directory:

Note: The default file name is '.user.ini', but it may also be nameed differently.

<directive>=<value>

Example:

To disable error tracking and modify the method tracking threshold, please use the key below:

zpa.track_errors=0
zpa.method_threshold=5