Overview

This document lists the PHP-FPM system's configuration settings and their default values. This document also explains how to add additional settings to your system's PHP-FPM configuration.

Warning:

We strongly recommend that you only activate Apache PHP-FPM if your server has at least 2 GB of RAM available, or at least 30 MB of RAM per domain. If you enable PHP-FPM on a server with less than the required RAM, your server may experience severe performance issues.

Global directives

cPanel & WHM uses template values for defaults. For example, when the [% ea_php_version %] template value appears in the .yaml file, the system replaces this value with the desired PHP version. The following list outlines the global directives labels:

Key — The entry in the .yaml file.

Name — The pool name in the /var/cpanel/ApachePHPFPM/system_pool_defaults.yaml configuration file.

Present if not listed — When you set this value to Yes, the system adds the value to the
/var/cpanel/userdata/user/domain.php_fpm.yaml configuration file, where user represents the cPanel user's name and domain represents the domain.

Default — The template value that resides in the /var/cpanel/ApachePHPFPM/system.yaml configuration file.

Warning:

You must normalize the period character (.) to an underscore character (_) for all key names when you create or modify the /var/cpanel/ApachePHPFPM/system.yaml file. For example, you would normalize syslog.ident to syslog_ident. Otherwise, the system may not accept the key name.

Exercise extreme caution when you manually edit .yaml files. Incorrect syntax in these files will cause services to fail. We strongly suggest that you create a backup of your system before you manually edit .yaml files.

Key

Name

Present if not listed

Default

pid

pid

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

error_log

error_log

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

log_level

log_level

notice

syslog_facility

syslog.facility

daemon

syslog_ident

syslog.ident

php-fpm

emergency_restart_threshold

emergency_restart_threshold

0

emergency_restart_interval

emergency_restart_interval

0

process_control_timeout

process_control_timeout

10

process_max

process.max

0

process_priority

process.priority

N/A

daemonize

daemonize

no

rlimit_files

rlimit_files

N/A

rlimit_core

rlimit_core

0

events_mechanism

events.mechanism

N/A

systemd_interval

systemd_interval

10

Pool name directives

PHP-FPM pools allow you to configure different websites and applications to run under their own user. The following table lists directives that you can configure in the /var/cpanel/ApachePHPFPM/system_pool_defaults.yaml file:

Key

Name

Present if not listed

Default

user

user

"[% username %]"

group

group

nobody

listen

listen

"[% socket_path %]"

listen_owner

listen.owner

"[% username %]"

listen_group

listen.group

nobody

listen_mode

listen.mode

0660

php_admin_value_disable_functions

php_admin_value[disable_functions]

exec,passthru,shell_exec,system

php_admin_flag_allow_url_fopen

php_admin_flag[allow_url_fopen]

on

php_admin_value_short_open_tag

php_admin_value[short_open_tag]

on

php_admin_value_doc_root

php_admin_value[doc_root]

[% documentroot %]

Notes:

When you specify a vhost document root for subdomains, the system does not escape the vhost correctly in the subdomain's PHP-FPM configuration file.

PHP-FPM does not process certain characters in the document root unless you add double quotes ("") around the document root.

You can also add the colon(:), semicolon (;), and parenthesis (()) characters to the document root.

php_admin_value_error_log

php_admin_value[error_log]

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

Note:

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

If you prepend any PHP settings with the php_value or php_flag flags, the system will overwrite any previous php.ini values that you set in the user's .htaccess files. To remove these flags, run the following commands:

cPanel, WebHost Manager, and WHM are registered trademarks of cPanel, Inc. for providing its computer software that facilitates the management and configuration of Internet web servers. ®2018 All rights reserved.