Introduction
This article will show you how to customize the 'pm' setting in PHP-FPM configuration globally or for an individual domain(s) PHP-FPM configuration. The default value of the 'pm' setting is 'on-demand.'
Please note that cPanel, LLC only supports the cPanel-provided software and does not provide general system-administration or site optimization services. You may, therefore, wish to seek assistance from a qualified system administrator for further guidance on PHP configuration.
System Administration Services
More information on the pm setting can be found here:
php.net - PHP-FPM Configuration
Procedure
Global
1. Connect to your server via SSH or WHM >> Terminal as root.
2. Create the /var/cpanel/ApachePHPFPM/ directory:
mkdir -v /var/cpanel/ApachePHPFPM/
3. Create the /var/cpanel/ApachePHPFPM/system_pool_defaults.yaml file:
touch /var/cpanel/ApachePHPFPM/system_pool_defaults.yaml
4. Open the /var/cpanel/ApachePHPFPM/system_pool_defaults.yaml file using any preferred command-line text editor, such as vi, vim, nano, etc. (See: How to edit a file on command-line)
5. Add the following contents to the file and customize the 'pm' setting by replacing $VALUE with the desired value:
---
pm: $VALUE
Example:
---
pm: dynamic
5. Save and close the file.
6. Run the following script to load the change:
/scripts/php_fpm_config --rebuild
Individual domain(s)
1. Connect to your server via SSH or WHM >> Terminal as root.
2. Create a /var/cpanel/userdata/$USER/$DOMAIN.TLD.php-fpm.yaml file (replace $USER with the cPanel username and $DOMAIN.TLD with the domain name):
touch /var/cpanel/userdata/$USER/$DOMAIN.TLD.php-fpm.yaml
Example:
touch /var/cpanel/userdata/exampleuser/example.tld.php-fpm.yaml
3. Open the file using any preferred command-line text editor. (See: How to edit a file on command-line)
4. Add the following contents to the file and customize the 'pm' setting by replacing $VALUE with the desired value:
---
_is_present: 1
pm: $VALUE
Example:
---
_is_present: 1
pm: dynamic
5. Save and close the file.
6. Run the following script to load the change:
/scripts/php_fpm_config --rebuild