Skip to content

Commit

Permalink
Use php7.0 (#1)
Browse files Browse the repository at this point in the history
* Add travis support

* Install php fpm 7.0
  • Loading branch information
goruha authored Nov 29, 2017
1 parent c3bdb4a commit e35ed04
Show file tree
Hide file tree
Showing 28 changed files with 52 additions and 42 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.build-harness
20 changes: 20 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
sudo: required
addons:
apt:
packages:
- git
- make
- curl
env:
- DOCKER_IMAGE_NAME=cloudposse/apache-php-fpm
services:
- docker
install:
- make init
- make docker:login

script:
- make docker:build

after_success:
- make travis:docker-tag-and-push
14 changes: 5 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM cloudposse/apache-php
FROM cloudposse/apache-php:latest

MAINTAINER Erik Osterman "[email protected]"

Expand All @@ -23,25 +23,21 @@ RUN apt-get update && \
apt-add-repository multiverse && \
apt-get update && \
apt-get -y install \
apache2-mpm-event \
libapache2-mod-fastcgi \
php5-fpm && \
php-fpm && \
apt-get clean && \
rm -f /var/www/html/index.html && \
echo '<?php // silence is golden ?>' > /var/www/html/index.php

ADD conf-available/ /etc/apache2/conf-available/
ADD mods-available/ /etc/apache2/mods-available/
ADD fpm/ /etc/php5/fpm/
ADD start /start
ADD rootfs /

RUN a2dismod mpm_prefork && \
a2dismod mpm_worker && \
a2dismod php5 && \
a2dismod php7.0 && \
a2enmod mpm_event && \
a2enmod actions && \
a2enmod fastcgi && \
a2enmod alias && \
a2enconf php5-fpm
a2enconf php7.0-fpm


1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
-include $(shell curl -sSL -o .build-harness "https://git.io/build-harness"; echo .build-harness)
12 changes: 0 additions & 12 deletions conf-available/php5-fpm.conf

This file was deleted.

9 changes: 9 additions & 0 deletions rootfs/etc/apache2/conf-available/php7.0-fpm.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<IfModule mod_fastcgi.c>
AddHandler php7-fcgi .php
Action php7-fcgi /php7-fcgi
Alias /php7-fcgi /usr/lib/cgi-bin/php7-fcgi
FastCgiExternalServer /usr/lib/cgi-bin/php7-fcgi -socket /var/run/php/php7.0-fpm.sock -pass-header Authorization
<Directory /usr/lib/cgi-bin>
Require all granted
</Directory>
</IfModule>
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
33 changes: 14 additions & 19 deletions fpm/php-fpm.conf → rootfs/etc/php/7.0/fpm/php-fpm.conf
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,6 @@
; prefix (/usr). This prefix can be dynamically changed by using the
; '-p' argument from the command line.

; Include one or more files. If glob(3) exists, it is used to include a bunch of
; files from a glob(3) pattern. This directive can be used everywhere in the
; file.
; Relative path can also be used. They will be prefixed by:
; - the global prefix if it's been set (-p argument)
; - /usr otherwise
;include=/etc/php5/fpm/*.conf

;;;;;;;;;;;;;;;;;;
; Global Options ;
;;;;;;;;;;;;;;;;;;
Expand All @@ -22,14 +14,14 @@
; Pid file
; Note: the default prefix is /var
; Default Value: none
pid = /var/run/php5-fpm.pid
pid = /run/php/php7.0-fpm.pid

; Error log file
; If it's set to "syslog", log is sent to syslogd instead of being written
; in a local file.
; Note: the default prefix is /var
; Default Value: log/php-fpm.log
error_log = /var/log/php5-fpm.log
error_log = /var/log/php7.0-fpm.log

; syslog_facility is used to specify what type of program is logging the
; message. This lets syslogd specify that messages from different facilities
Expand All @@ -55,7 +47,7 @@ error_log = /var/log/php5-fpm.log
; Default Value: 0
;emergency_restart_threshold = 0

; Interval of time used by emergency_restart_interval to determine when
; Interval of time used by emergency_restart_interval to determine when
; a graceful restart will be initiated. This can be useful to work around
; accidental corruptions in an accelerator's shared memory.
; Available Units: s(econds), m(inutes), h(ours), or d(ays)
Expand Down Expand Up @@ -87,18 +79,18 @@ error_log = /var/log/php5-fpm.log
; Send FPM to background. Set to 'no' to keep FPM in foreground for debugging.
; Default Value: yes
;daemonize = yes

; Set open file descriptor rlimit for the master process.
; Default Value: system defined value
;rlimit_files = 1024

; Set max core size rlimit for the master process.
; Possible Values: 'unlimited' or an integer greater or equal to 0
; Default Value: system defined value
;rlimit_core = 0

; Specify the event mechanism FPM will use. The following is available:
; - select (any POSIX os)
; - select (any POSIX os)
; - poll (any POSIX os)
; - epoll (linux >= 2.5.44)
; - kqueue (FreeBSD >= 4.1, OpenBSD >= 2.9, NetBSD >= 2.0)
Expand All @@ -116,15 +108,18 @@ error_log = /var/log/php5-fpm.log
;systemd_interval = 10

;;;;;;;;;;;;;;;;;;;;
; Pool Definitions ;
; Pool Definitions ;
;;;;;;;;;;;;;;;;;;;;

; Multiple pools of child processes may be started with different listening
; ports and different management options. The name of the pool will be
; used in logs and stats. There is no limitation on the number of pools which
; FPM can handle. Your system will tell you anyway :)

; To configure the pools it is recommended to have one .conf file per
; pool in the following directory:
include=/etc/php5/fpm/pool.d/*.conf

; Include one or more files. If glob(3) exists, it is used to include a bunch of
; files from a glob(3) pattern. This directive can be used everywhere in the
; file.
; Relative path can also be used. They will be prefixed by:
; - the global prefix if it's been set (-p argument)
; - /usr otherwise
include=/etc/php/7.0/fpm/pool.d/*.conf
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ group = www-data
; specific port;
; '/path/to/unix/socket' - to listen on a unix socket.
; Note: This value is mandatory.
listen = /var/run/php5-fpm.sock
listen = /var/run/php/php7.0-fpm.sock

; Set listen(2) backlog.
; Default Value: 65535 (-1 on FreeBSD and OpenBSD)
Expand Down
2 changes: 1 addition & 1 deletion start → rootfs/start
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ m4 -DPHP_FPM_PM="{{$PHP_FPM_PM}}" \
-DPHP_FPM_MAX_REQUESTS="{{$PHP_FPM_MAX_REQUESTS}}" /etc/php5/fpm/pool.d/www.conf.m4 > /etc/php5/fpm/pool.d/www.conf


service php5-fpm start
service php7.0-fpm start

exec /usr/sbin/apache2 -D FOREGROUND $@

0 comments on commit e35ed04

Please sign in to comment.