doc/content/posts/20210326-php-fpm.md
Felix Niederwanger 0349adaedf
Update example webserver post
Update the example webserver to use Leap 15.4 and remove some issues
with the playbook and description.
2022-06-29 11:45:09 +02:00

1.8 KiB

title author date
Ansible php-fpm phoenix 2021-03-26T09:42:03+01:00

The geekoops-php-fpm role is intended as a standalone php-fpm deployment that works in conjunction with any webserver. I use it with nginx in production. In principle it should also work together with apache2, but that's something currently untested.

This role works with openSUSE Leap and is intended to ship enough requirements for most web applications to run. I run it in conjunction with Mediawiki and Nextcloud.

Role Variables

This ansible role comes with a large set of configuration parameters. Among others here are some of the most important ones:

Value Description Default
configure_php_ini Configrue the php.ini file true
configure_php_fpm Configure php-fpm configuration files true
enable_php_fpm Enable php-fpm service true
apcu_enable Enable the APCu cache false
apcu_shm_size APCu cache size 32M
php_memlimit PHP memory limit 128M
php_uploads Enable PHP uploads On
php_maxuploadsize Max upload size 256M
php_maxuploads Max uploads in a request 20

Example

This role installs only php-fpm. It works best together with the nginx role, but you can also use it as a standalone:

---
- hosts: jellyfish
  user: root

  roles:
    - role: geekoops-php-fpm
      vars:
        apcu_enable: true
        apcu_shm_size: 32M
        php_memlimit: 256M
        php_maxuploadsize: 64M

A more extended example of this role together with nginx can be found in the Example Webserver post.