This document illustrates the creation of user pool with PHP-FPM by the system.
The pools are created when the /var/cpanel/userdata/[user]/[domain].php_fpm.yaml configuration file exist in the domain. File must include the lines given below:
Any desired pool values can be placed in this file, including the — line above the pool values. Although _is_present value is optional, but needs to be included in case one did not set any other values in the file.
One must be aware when they manually edit .yaml files. Incorrect syntax will lead the services to failure. Hence, it is strongly recommended to create a backup of your system before manually editing .yaml files.
Keep a note that this file only comprises the differences of directives from the built-in default directives.
One can run the Cpanel::PHPFPM::rebuild_files() function or /scripts/php_fpm_config –rebuild script in order to create a pool.
The system however, will remove any conf files that is existing and do not have a corresponding domain.yaml file.
The FPM socket is created by the system in the /opt/cpanel/phpversion/root/usr/var/run/php-fpm/obscure_domain.sock directory. Here, the phpversion denotes the version of PHP, and obscure_domain denotes a hashed version of the domain which will resemble the following example:
The system will restart the pools when the pool and system configurations will exist in their designated locations. The whole procedure of restarting method depends on whether it runs as a systemd or an init.d system. The system will then eliminate any PHP version pools that do not hold domains with that version.
After creating the user pool, the system naturally binds them to the virtfs mount if these conditions exist as mentioned below:
Everything about the creation of a user pool with PHP-FPM is outlined in this article.