~sirn/ansible-freebsd-s6-php

Ansible role for installing and configuring PHP on S6-enabled FreeBSD host

refs

master
browse  log 

clone

read-only
https://git.sr.ht/~sirn/ansible-freebsd-s6-php
read/write
git@git.sr.ht:~sirn/ansible-freebsd-s6-php

You can also use your local clone with git send-email.

#ansible-freebsd-s6-php

builds.sr.ht status

Configure PHP for FreeBSD host using S6.

Requires ansible-freebsd-s6 to be applied first.

#Variables

#php_fpm_address
php_fpm_address: 0.0.0.0:9000

Listen address for PHP-FPM. Can be either TCP or socket, e.g.

  • TCP: 0.0.0.0:9000
  • Socket: /var/run/php-fpm/php-fpm.sock
#php_fpm_config
php_fpm_config:

Extra PHP-FPM configuration to be append to php-fpm.ini, e.g.

php_fpm_config: |
    env[HOSTNAME] = $HOSTNAME
    env[PATH] = /usr/local/bin:/usr/bin:/bin
    env[TEMP] = /tmp
    env[TMPDIR] = /tmp
    env[TMP] = /tmp
#php_fpm_logger
php_fpm_logger: |
    #!/usr/local/bin/execlineb -P
    s6-log -b n10 s1000000 t !"gzip -nq9" /var/log/php-fpm/

Configure a PHP-FPM logger. See also s6-log.

#php_fpm_pm
php_fpm_pm: dynamic

Configure how the process manager will control the number of child processes. Can be one of:

  • static the number of child process is fixed based on php_fpm_max_children
  • ondemand the processes are spawned on demand based on php_fpm_start_servers
  • dynamic the processes are set dynamically based on the following variables:
    • php_fpm_max_children
    • php_fpm_start_servers
    • php_fpm_min_spare_servers
    • php_fpm_max_spare_servers
#php_fpm_max_children
php_fpm_max_children: 5

Maximum number of children to spawn. Only used when php_fpm_pm is set to static or dynamic.

#php_fpm_max_requests
php_fpm_max_requests: 1000

Maximum number of requests the children will execute before respawned. This setting is useful when an application is known to have memory leak. Can be set to 0 to disable.

#php_fpm_max_spare_servers
php_fpm_max_spare_servers: 3

Maximum number of idle children. Only used when php_fpm_pm is set to dynamic.

#php_fpm_min_spare_servers
php_fpm_min_spare_servers: 1

Minimum number of idle children. Only used when php_fpm_pm is set to dynamic.

#php_fpm_start_servers
php_fpm_start_servers: 2

Number of servers to start when PHP-FPM boot up. Only used when php_fpm_pm is set to dynamic.

#php_fpm_version
php_fpm_version: php73

Version of PHP to install.

#php_max_execution_time
php_max_execution_time: 120

Number of seconds to wait for process to finish executing a request. Any process taking longer than this value will be terminated and respawned.

#php_max_input_time
php_max_input_time: 60

Number of seconds to wait for process to read the input. Any process taking longer than this value when reading request will be terminated and respawned.

#php_memory_limit
php_memory_limit: 512M

Maximum amount of memory a single script is allowed to consume.

#php_post_max_size
php_post_max_size: 144M

Maximum size of a POST request. This configuration should be set higher than that of php_upload_max_size.

#php_upload_file_max_size
php_upload_max_filesize: 128M

Maximum file size of a single file in POST request. One POST request may contains several files, plus headers and POST data, of which may not exceed the php_upload_max_size.