Giter Site home page Giter Site logo

ardem / php7.ansible.role Goto Github PK

View Code? Open in Web Editor NEW

This project forked from chusiang/php7.ansible.role

0.0 1.0 0.0 49 KB

Ansible Role: PHP 7 (php-fpm) for Nginx on Ubuntu and CentOS.

Home Page: https://galaxy.ansible.com/chusiang/php7/

License: MIT License

Makefile 100.00%

php7.ansible.role's Introduction

Ansible Role: PHP7 (PHP-FPM)

Build Status Ansible Galaxy Docker Hub

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

  • Current PHP7 version:

  • Debian & Ubuntu: 7.0.6

  • CentOS: 7.0.5

Requirements

None.

Role Variables

Available variables are listed below, along with default values (see defaults/main.yml):

# All.
php_timezone: Asia/Taipei
php_upload_max_filesize: "20M"
php_post_max_size: "20M"
php_memory_limit: "1024M"

# Debian & Ubuntu.
debian_php7_apt_repo: "http://packages.dotdeb.org"
debian_php7_apt_key: "https://www.dotdeb.org/dotdeb.gpg"
ubuntu_php7_ppa_repo: "ppa:ondrej/php"

apt_php_packages:
  - php7.0
  - php7.0-cgi
  - php7.0-cli
  - php7.0-common
  - php7.0-curl
  - php7.0-fpm
  - php7.0-gd
  - php7.0-intl
  - php7.0-json
  - php7.0-mysql
  #- php7.0-pear

yum_php_packages:
  - php70u-cli
  - php70u-common
  - php70u-fpm
  - php70u-fpm-nginx
  - php70u-json
  - php70u-mysqlnd
  - php70u-opcache
  - php70u-pdo
  #- php70u-mbstring
  #- php70u-pear

# need use 'www-data' on Debian8.
php_owner: nginx
php_group: nginx

php_processes_owner: www-data
php_processes_group: www-data

Note

  1. If you see some error message, maybe you need modify php_owner and php_group from nginx to www-data.
  • Browser:

    An error occurred.

  • error.log:

    connect() to unix:/var/run/php/php7.0-fpm.sock failed (13: Permission denied) while connecting to upstream ...

  1. The /target/path/ of socket, configure files is difference on Ubuntu and CentOS. Be careful your Nginx setting !
  • Debian & Ubuntu:

    • Configure:
      • /etc/php/7.0/fpm/php.ini
      • /etc/php/7.0/cli/php.ini
    • Socket: /var/run/php/php7.0-fpm.sock
  • CentOS:

    • Configure:
      • /etc/php-fpm.d/www.conf
      • /etc/php.ini
    • Socket: /run/php-fpm/www.sock

Dependencies

None.

By the way, if you need to setup nginx, you can use williamyeh.nginx role.

Example Playbook

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

Docker Container

This repository contains Dockerized Ansible, published to the public Docker Hub via automated build mechanism.

Docker Hub: chusiang/php7

Images

  • chusiang/php7:ubuntu14.04 (lastest)
  • chusiang/php7:centos6

Usage

$ docker run -it -v /src:/data chusiang/php7:ubuntu14.04 bash
[root@a68e807eec8f tmp]# php -v
PHP 7.0.7 (cli) (built: May 31 2016 11:36:12) ( NTS )
Copyright (c) 1997-2016 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies
    with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2016, by Zend Technologies

License

Copyright (c) chusiang from 2016 under the MIT license.

php7.ansible.role's People

Contributors

akondas avatar ardem avatar chusiang avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.