TheDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/wikioasis/salt/llms.txt
Use this file to discover all available pages before exploring further.
php state installs a specific PHP version and a curated set of extensions required by MediaWiki, then writes the PHP-FPM pool configuration from a Jinja template controlled entirely by pillar. Process manager settings such as pm.max_children, start servers, spare server counts, and request limits are all tunable per environment without modifying any template files. The service is managed by Salt and automatically reloads whenever the pool configuration changes.
Package installation
The state readsphp:version, php:extensions, and php:extra_packages from pillar to build a single pkg.installed call:
php:version prefix is prepended to each extension name automatically. extra_packages (like php-excimer and php-luasandbox) are installed as-is since they are version-independent.
Pillar keys
| Key | Default | Description |
|---|---|---|
php:version | 8.3 | PHP version to install (e.g. 8.4) |
php:extensions | [fpm, mysql, xml, mbstring, intl, curl, gd, zip, apcu, igbinary] | Extension suffixes appended to php<version>- |
php:extra_packages | [php-excimer] | Additional packages installed without a version prefix |
php:fpm:pool | www | FPM pool name and config filename |
php:fpm:listen | (derived) | Listen address; defaults to unix:/run/php/php<version>-fpm.sock |
php:fpm:pm | dynamic | Process manager mode: dynamic, static, or ondemand |
php:fpm:pm_max_children | 10 | Maximum number of child processes |
php:fpm:pm_start_servers | 2 | Servers started at launch (dynamic mode) |
php:fpm:pm_min_spare_servers | 1 | Minimum idle servers kept alive (dynamic mode) |
php:fpm:pm_max_spare_servers | 3 | Maximum idle servers to keep alive (dynamic mode) |
php:fpm:pm_max_requests | 500 | Requests per worker before respawn (memory leak prevention) |
php:fpm:request_terminate_timeout | 60 | Seconds before a worker is hard-killed |
Production pillar
pm_start_servers, pm_min_spare_servers, and pm_max_spare_servers are only written to www.conf when pm is dynamic. They are omitted for static or ondemand modes.www.conf.jinja template
The pool configuration is written to/etc/php/<version>/fpm/pool.d/<pool>.conf from this template:
Notable settings
listen.acl_users
The socket is readable by
www-data and nagios, allowing the monitoring agent to check the FPM status page without a dedicated listen address.pm.max_requests
Workers are recycled after 500 requests by default. This acts as a safety valve against PHP memory leaks in long-running extensions.
ping / status
The
/ping and /status paths are enabled on all pools for health-check and monitoring use.request_terminate_timeout
Requests running longer than 60 seconds are hard-killed. This prevents runaway maintenance scripts from blocking the pool.
Service management
The PHP-FPM service is declared asphp<version>-fpm and is set to watch the pool config file:
state.apply.