Skip to content

Commit e35ed04

Browse files
authored
Use php7.0 (#1)
* Add travis support * Install php fpm 7.0
1 parent c3bdb4a commit e35ed04

28 files changed

+52
-42
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.build-harness

.travis.yml

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
sudo: required
2+
addons:
3+
apt:
4+
packages:
5+
- git
6+
- make
7+
- curl
8+
env:
9+
- DOCKER_IMAGE_NAME=cloudposse/apache-php-fpm
10+
services:
11+
- docker
12+
install:
13+
- make init
14+
- make docker:login
15+
16+
script:
17+
- make docker:build
18+
19+
after_success:
20+
- make travis:docker-tag-and-push

Dockerfile

+5-9
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM cloudposse/apache-php
1+
FROM cloudposse/apache-php:latest
22

33
MAINTAINER Erik Osterman "[email protected]"
44

@@ -23,25 +23,21 @@ RUN apt-get update && \
2323
apt-add-repository multiverse && \
2424
apt-get update && \
2525
apt-get -y install \
26-
apache2-mpm-event \
2726
libapache2-mod-fastcgi \
28-
php5-fpm && \
27+
php-fpm && \
2928
apt-get clean && \
3029
rm -f /var/www/html/index.html && \
3130
echo '<?php // silence is golden ?>' > /var/www/html/index.php
3231

33-
ADD conf-available/ /etc/apache2/conf-available/
34-
ADD mods-available/ /etc/apache2/mods-available/
35-
ADD fpm/ /etc/php5/fpm/
36-
ADD start /start
32+
ADD rootfs /
3733

3834
RUN a2dismod mpm_prefork && \
3935
a2dismod mpm_worker && \
40-
a2dismod php5 && \
36+
a2dismod php7.0 && \
4137
a2enmod mpm_event && \
4238
a2enmod actions && \
4339
a2enmod fastcgi && \
4440
a2enmod alias && \
45-
a2enconf php5-fpm
41+
a2enconf php7.0-fpm
4642

4743

Makefile

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
-include $(shell curl -sSL -o .build-harness "https://git.io/build-harness"; echo .build-harness)

conf-available/php5-fpm.conf

-12
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<IfModule mod_fastcgi.c>
2+
AddHandler php7-fcgi .php
3+
Action php7-fcgi /php7-fcgi
4+
Alias /php7-fcgi /usr/lib/cgi-bin/php7-fcgi
5+
FastCgiExternalServer /usr/lib/cgi-bin/php7-fcgi -socket /var/run/php/php7.0-fpm.sock -pass-header Authorization
6+
<Directory /usr/lib/cgi-bin>
7+
Require all granted
8+
</Directory>
9+
</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.

fpm/php-fpm.conf renamed to rootfs/etc/php/7.0/fpm/php-fpm.conf

+14-19
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,6 @@
66
; prefix (/usr). This prefix can be dynamically changed by using the
77
; '-p' argument from the command line.
88

9-
; Include one or more files. If glob(3) exists, it is used to include a bunch of
10-
; files from a glob(3) pattern. This directive can be used everywhere in the
11-
; file.
12-
; Relative path can also be used. They will be prefixed by:
13-
; - the global prefix if it's been set (-p argument)
14-
; - /usr otherwise
15-
;include=/etc/php5/fpm/*.conf
16-
179
;;;;;;;;;;;;;;;;;;
1810
; Global Options ;
1911
;;;;;;;;;;;;;;;;;;
@@ -22,14 +14,14 @@
2214
; Pid file
2315
; Note: the default prefix is /var
2416
; Default Value: none
25-
pid = /var/run/php5-fpm.pid
17+
pid = /run/php/php7.0-fpm.pid
2618

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

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

58-
; Interval of time used by emergency_restart_interval to determine when
50+
; Interval of time used by emergency_restart_interval to determine when
5951
; a graceful restart will be initiated. This can be useful to work around
6052
; accidental corruptions in an accelerator's shared memory.
6153
; Available Units: s(econds), m(inutes), h(ours), or d(ays)
@@ -87,18 +79,18 @@ error_log = /var/log/php5-fpm.log
8779
; Send FPM to background. Set to 'no' to keep FPM in foreground for debugging.
8880
; Default Value: yes
8981
;daemonize = yes
90-
82+
9183
; Set open file descriptor rlimit for the master process.
9284
; Default Value: system defined value
9385
;rlimit_files = 1024
94-
86+
9587
; Set max core size rlimit for the master process.
9688
; Possible Values: 'unlimited' or an integer greater or equal to 0
9789
; Default Value: system defined value
9890
;rlimit_core = 0
9991

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

118110
;;;;;;;;;;;;;;;;;;;;
119-
; Pool Definitions ;
111+
; Pool Definitions ;
120112
;;;;;;;;;;;;;;;;;;;;
121113

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

127-
; To configure the pools it is recommended to have one .conf file per
128-
; pool in the following directory:
129-
include=/etc/php5/fpm/pool.d/*.conf
130-
119+
; Include one or more files. If glob(3) exists, it is used to include a bunch of
120+
; files from a glob(3) pattern. This directive can be used everywhere in the
121+
; file.
122+
; Relative path can also be used. They will be prefixed by:
123+
; - the global prefix if it's been set (-p argument)
124+
; - /usr otherwise
125+
include=/etc/php/7.0/fpm/pool.d/*.conf
File renamed without changes.

fpm/pool.d/www.conf.m4 renamed to rootfs/etc/php/7.0/fpm/pool.d/www.conf.m4

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ group = www-data
3939
; specific port;
4040
; '/path/to/unix/socket' - to listen on a unix socket.
4141
; Note: This value is mandatory.
42-
listen = /var/run/php5-fpm.sock
42+
listen = /var/run/php/php7.0-fpm.sock
4343

4444
; Set listen(2) backlog.
4545
; Default Value: 65535 (-1 on FreeBSD and OpenBSD)

start renamed to rootfs/start

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,6 @@ m4 -DPHP_FPM_PM="{{$PHP_FPM_PM}}" \
1818
-DPHP_FPM_MAX_REQUESTS="{{$PHP_FPM_MAX_REQUESTS}}" /etc/php5/fpm/pool.d/www.conf.m4 > /etc/php5/fpm/pool.d/www.conf
1919

2020

21-
service php5-fpm start
21+
service php7.0-fpm start
2222

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

0 commit comments

Comments
 (0)