roots / trellis

WordPress LEMP stack with PHP 8.2, Composer, WP-CLI and more
https://roots.io/trellis/
MIT License
2.51k stars 607 forks source link

Allow overriding "pm" in PHP-FPM's pool config #1542

Closed gutobenn closed 3 months ago

gutobenn commented 3 months ago

This PR adds support for overriding the value of 'pm' in PHP-FPM's pool config.

This can be done by setting a value to the variable php_fpm_pm, just like you can already do to other configs.

Example:

# group_vars/all/php.yml
php_fpm_pm: 'static'
swalkinshaw commented 3 months ago

allowing different settings for each environment.

The goal is for each environment (eg: production, staging, etc) and not per site? If so, this might be confusing since usually parameters under a site are meant to be site specific, but the config created is not site specific.

gutobenn commented 3 months ago

@swalkinshaw Thanks for the feedback! I've reformulated my solution.

It seems that the other parameters (e.g., php_fpm_pm_max_children, php_fpm_pm_start_servers, and so on) might already be overridden. Therefore, I adjusted the php-fpm-pool-wordpress.conf.j2 code to also support overriding the pm.

swalkinshaw commented 3 months ago

Thanks @gutobenn