PHP-FPM Configurable Options


Overview

This document lists the cPanel PHP-FPM system's configuration settings and their default values. It also explains how you can add additional configuration values other than the ones listed below.

Global directives

cPanel & WHM uses template values for defaults. For example, when you see [% ea_php_version %], the system replaces this with the desired PHP version. The following list represents the important labels for global directives:

  • Key — The entry that you create in the YAML file.
  • Name — The name in the PHP-FPM configuration file.
  • Present if not listed — When you set this value to Yes, the system adds it to the configuration file even if the YAML file does not list it.
  • Default — The template value inside the configuration file. If you do not add a specific value, the system defaults to this value.

Key
Name
Present if not listed

Default

pid pid Yes /opt/cpanel/[% ea_php_version %]/root/usr/var/run/php-fpm/php-fpm.pid
error_log error_log Yes

/opt/cpanel/[% ea_php_version %]/root/usr/var/log/php-fpm/error.log

log_level log_level Yes notice
syslog_facility syslog.facility No daemon
syslog_ident syslog.ident No php-fpm
emergency_restart_threshold emergency_restart_threshold Yes 0
emergency_restart_interval emergency_restart_interval Yes 0
process_control_timeout process_control_timeout Yes 0
process_max process.max No

0

process_priority process.priority No N/A
daemonize daemonize Yes no
rlimit_files rlimit_files No

N/A

rlimit_core rlimit_core No 0
events_mechanism events.mechanism No N/A
systemd_interval systemd_interval No 10

Pool directives

Key
Name
Present if not listed
Default
user user Yes "[% username %]"
group group Yes nobody
listen listen Yes "[% socket_path %]"
listen_owner listen.owner Yes "[% username %]"
listen_group listen.group Yes nobody
listen_mode listen.mode Yes 0660
php_admin_value_disable_functions php_admin_value[disable_functions] Yes exec,passthru,shell_exec,system
php_admin_flag_allow_url_fopen php_admin_flag[allow_url_fopen] Yes on
php_admin_value_short_open_tag php_admin_value[short_open_tag] Yes on
php_admin_value_doc_root php_admin_value[doc_root] Yes

[% documentroot %]

Note:

When you specify a vhost document root for subdomains in the creation of a domain, the system does not escape it correctly when rendered in the PHP-FPM configuration file for the subdomain. PHP-FPM does not handle certain punctuation characters in the document root well unless the document root is surrounded by double quotes (""). cPanel, Inc.® now surrounds the document root with the "" characters. Your document root can also now contain the :;, and () punctuation characters and others.

 

 

php_admin_value_error_log php_admin_value[error_log] Yes

[% homedir %]/logs/[% scrubbed_domain %].php.error.log

Note:

The system normalizes the dot character (.) to an underscore character (_) for the domain. For example, the /home/example/logs/example.net.php.error.log file will become the/home/example/logs/example_net.php.error.log file, where examplerepresents the username and example_net represents the domain name.

 

php_admin_flag_log_errors php_admin_flag[log_errors] Yes on
php_admin_value_error_reporting php_admin_value[error_reporting] Yes E_ALL & ~E_NOTICE
pm pm Yes ondemand
pm_max_children pm.max_children Yes 5
pm_start_servers pm.start_servers Yes 0
pm_min_spare_servers pm.min_spare_servers Yes 1
pm_max_spare_servers pm.max_spare_servers Yes 5
pm_process_idle_timeout pm.process_idle_timeout Yes 10
chdir chdir Yes [% homedir %]
catch_workers_output catch_workers_output Yes yes
listen_backlog listen.backlog No -1
listen_allowed_clients listen.allowed_clients No any
listen_acl_users listen.acl_users No N/A
listen_acl_groups listen.acl_groups No N/A
pm_max_requests pm.max_requests Yes 20 
pm_status_path pm.status_path Yes /status
ping_path ping.path Yes /ping
request_terminate_timeout request_terminate_timeout No

N/A

request_slowlog_timeout request_slowlog_timeout No N/A
rlimit_files rlimit_files No N/A
rlimit_core rlimit_core No N/A
chroot chroot No N/A
clean_env clean_env No N/A
security_limit_extensions security.limit_extensions Yes

The system allows the following options:

  • .phtml
  • .php
  • .php3
  • .php4
  • .php5
  • .php6
  • .php7
slowlog slowlog No

N/A

php_value_session_save_handler php_value[session.save_handler] No N/A
php_value_session_save_path php_value[session.save_path] No N/A
php_value_soap_wsdl_cache_dir php_value[soap.wsdl_cache_dir] No N/A

How to add an unknown value to a configuration

If you desire a value that cPanel does not currently provide as a default (the tables do not list a value), you can set a new value with a YAML map.

For example, you may add the following line to create a YAML map:

php_admin_value_ldap_max_links: { name: 'php_admin_value[ldap.max_links]', value: -1 }

In this example:

  • The php_admin_value_ldap_max_links value represents the Key .
  • The Key must only contain letters, numbers, and underscores.
  • The php_admin_value[ldap.max_links] value represents the Name and will display in the PHP-FPM configuration file.
  • The value key represents the configuration value that you wish to create.

How to remove default values from a configuration

The system allows you to override default values or remove them from the output.

  • To change a default value, run the following command:

    php_admin_flag_log_errors: no

    Note:

    The system defaults to Yes. In this example, we disabled the php_admin_flag_log_errors setting.

  • To remove a default value, add the following line to your YAML file:

    php_admin_flag_log_errors: { present_ifdefault: 0 }
     
  • php, fastcgi, php-fpm
  • 148 Bu dökümanı faydalı bulan kullanıcılar:
Bu cevap yeterince yardımcı oldu mu?

Related Articles

Remove a Service from ChkServd Monitoring for cPanel Servers

This guide requires root user account in server. In some circumstances, ChkservD cPanel...

Assigning a Dedicated IP Address to a Subdomain using WHM

To assign a dedicated IP address to a subdomain, perform the following steps: Step 1: Add the...

Enable Lets Encrypt AutoSSL Provider

This article refers to cPanel version 84 and later. Enable Let's Encrypt for AutoSSL Follow...

How to Fix Incorrect cPanel Account Quotas and Disk Usage

This article will provide a step-by-step guide to fix incorrect account quotas and disk usage on...

How to Uninstall Installatron in WHM cPanel Server

This guide will show you how to quickly uninstall Installatron software from WHM/cPanel server....