chusiang.php7

Ansible Role: PHP 7 (PHP-FPM)

This Ansible role helps you install PHP 7 (PHP-FPM) for Nginx. It is based on a fork of another project.

  • Current PHP 7 version:

    • Debian & Ubuntu: 7.1.30
    • CentOS: 7.1.30
  • Supported Linux distributions:

    1. Ubuntu 18.04
    2. Ubuntu 16.04
    3. Debian 8
    4. Debian 9
    5. CentOS 6
    6. CentOS 7

Requirements

None.

Role Variables

Here are the key configuration options and their default values:

#######
# All #
#######

# Debug mode
debug_mode: false

# Allow URL fopen
php_allow_url_fopen: "Off"

# Disabled functions
php_disable_functions: "exec,passthru,shell_exec,system,proc_open,popen"
php_display_errors: "Off"
php_error_reporting: "E_ALL & ~E_DEPRECATED & ~E_STRICT"

# PHP version exposure
php_expose_php: 'Off'

# Memory and upload settings
php_memory_limit: "1024M"
php_post_max_size: "20M"
php_upload_max_filesize: "20M"
php_timezone: "Asia/Taipei"

# Owner and group settings
php_owner: 'www-data'
php_group: 'www-data'

###################
# Debian & Ubuntu #
###################

debian_php7_apt_repo: "http://packages.dotdeb.org"
ubuntu_php7_ppa_repo: "ppa:ondrej/php"

# Enable or disable third-party repository
apt_php_third_party_repo: true

# PHP packages to install
apt_php_version: "7.1"
apt_php_packages:
  - php{{ apt_php_version }}
  - php{{ apt_php_version }}-fpm
  - etc.

##########
# CentOS #
##########

yum_php_version: "71u"

yum_php_packages:
  - php{{ yum_php_version }}-fpm
  - etc.

Notes

  1. If you experience any errors related to permissions, you may need to change php_owner and php_group to match your Nginx settings.

  2. The paths for configuration files and sockets differ between Ubuntu and CentOS. Be cautious with your Nginx configuration!

  3. An option to use a third-party repository was added in version 1.3.6.

Dependencies

None.

If you need to set up Nginx, consider using the williamyeh.nginx role.

Example Playbook

- hosts: webservers
  roles:
    - { role: chusiang.php7 }

Docker Containers

This repository offers Docker images for easy use. You can find them on Docker Hub.

Images

  • chusiang/php7:ubuntu-16.04 (latest)
  • chusiang/php7:ubuntu-14.04
  • chusiang/php7:centos6 (not supported anymore)

Usage

$ docker run -it -v /src:/data chusiang/php7:ubuntu14.04 bash

History

  • As of May 4, 2019, support for Ubuntu 14.04 has ended.

License

This software is licensed under the MIT License. For more details, see the LICENSE file.

Authors

  1. itcraftsmanpl (Arkadiusz Kondas)
  2. chusiang (Chu-Siang Lai)
Informazioni sul progetto

Deploy PHP 7 (php-fpm) for nginx on Ubuntu, Debian and CentOS. (forked from itcraftsmanpl.php7)

Installa
ansible-galaxy install chusiang.php7
Licenza
mit
Download
2.3k
Proprietario
A system engineer, like @DevOpsTW, @ansible-tw, @vim-tw, docker and @linux-taiwan. Hope one day can build a "🦄 Unicorn company" like《The Phoenix Project》.