Ansible php-fpm

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 minimal set of configuration parameters.

configure_php_iniConfigrue the php.ini filetrue
configure_php_fpmConfigure php-fpm configuration filestrue
enable_php_fpmEnable php-fpm servicetrue
apcu_enableEnable the APCu cachefalse
apcu_shm_sizeAPCu cache size32M
php_memlimitPHP memory limit128M
php_uploadsEnable PHP uploadsOn
php_maxuploadsizeMax upload size256M
php_maxuploadsMax uploads in a request20


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

    - role: geekoops-php-fpm
        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.