Child pages
  • Configurations Values of PHP-FPM
Skip to end of metadata
Go to start of metadata

For cPanel & WHM version 66

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 /var/cpanel/userdata/user/domain.php_fpm.yaml configuration file.

    Note:

    • user represents the cPanel user's username.

    • domain represents the domain.

  • Present if not listed — When you set this value to Yes, the system adds it to the /var/cpanel/userdata/user/domain.php_fpm.yaml  configuration file even if the YAML file does not list it.
  • Default — The template value inside the /var/cpanel/userdata/user/domain.php_fpm.yaml  configuration file. If you do not add a specific value, the system defaults to this value.

KeyNamePresent if not listed

Default

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

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

log_levellog_levelYesnotice
syslog_facilitysyslog.facilityNodaemon
syslog_identsyslog.identNophp-fpm
emergency_restart_thresholdemergency_restart_thresholdYes0
emergency_restart_intervalemergency_restart_intervalYes0
process_control_timeoutprocess_control_timeoutYes0
process_maxprocess.maxNo

0

process_priorityprocess.priorityNoN/A
daemonizedaemonizeYesno
rlimit_filesrlimit_filesNo

N/A

rlimit_corerlimit_coreNo0
events_mechanismevents.mechanismNoN/A
systemd_intervalsystemd_intervalNo10

Pool directives

KeyNamePresent if not listedDefault
useruserYes"[% username %]"
groupgroupYesnobody
listenlistenYes"[% socket_path %]"
listen_ownerlisten.ownerYes " [% username %]"
listen_grouplisten.groupYesnobody
listen_modelisten.modeYes0660
php_admin_value_disable_functionsphp_admin_value[disable_functions]Yesexec,passthru,shell_exec,system
php_admin_flag_allow_url_fopenphp_admin_flag[allow_url_fopen]Yeson
php_admin_value_short_open_tagphp_admin_value[short_open_tag]Yeson
php_admin_value_doc_rootphp_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 (""). Your document root can also now contain the :;, and () punctuation characters.

 

php_admin_value_error_logphp_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 example represents the username and example_net represents the domain name.

php_admin_flag_log_errorsphp_admin_flag[log_errors]Yeson
php_value_error_reportingphp_value[error_reporting]Yes

E_ALL & ~E_NOTICE

Note:

In cPanel & WHM version 64, we updated the php_admin_value_error_reporting value to the php_value_error_reporting value. To use this update, run the following command on any domains that you created before this change occurred: 

/usr/local/cpanel/scripts/php_fpm_config --rebuild

pmpmYesondemand
pm_max_childrenpm.max_childrenYes5
pm_start_serverspm.start_serversYes0
pm_min_spare_serverspm.min_spare_serversYes1
pm_max_spare_serverspm.max_spare_serversYes5
pm_process_idle_timeoutpm.process_idle_timeoutYes10
chdirchdirYes[% homedir %]
catch_workers_outputcatch_workers_outputYesyes
listen_backloglisten.backlogNo-1
listen_allowed_clientslisten.allowed_clientsNoany
listen_acl_userslisten.acl_usersNoN/A
listen_acl_groupslisten.acl_groupsNoN/A
pm_max_requestspm.max_requestsYes 20
pm_status_pathpm.status_pathYes /status
ping_pathping.pathYes/ping
request_terminate_timeoutrequest_terminate_timeoutNo

N/A

request_slowlog_timeoutrequest_slowlog_timeoutNoN/A
rlimit_filesrlimit_filesNoN/A
rlimit_corerlimit_coreNoN/A
chrootchrootNoN/A
clean_envclean_envNoN/A
security_limit_extensionssecurity.limit_extensionsYes

The system allows the following options:

  • .phtml
  • .php
  • .php3
  • .php4
  • .php5
  • .php6
  • .php7
slowlogslowlogNo

N/A

php_value_session_save_handlerphp_value[session.save_handler]NoN/A
php_value_session_save_pathphp_value[session.save_path]NoN/A
php_value_soap_wsdl_cache_dirphp_value[soap.wsdl_cache_dir]NoN/A

How to add an unknown value to a configuration

If you desire a value that cPanel & WHM does not currently provide as a default, 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 }

    Notes:

    • When you set the present_ifdefault value to 0, the system does not display that value in the configuration file and ignores all other values.

    • You can only use this entry to disable this value in the output.

Rebuild the PHP-FPM configuration

After you change any of the values in the configuration file, you must rebuild the system's PHP-FPM configuration for the changes to occur. To do this, run the following command:

/usr/local/cpanel/scripts/php_fpm_config --rebuild


Additional documentation