Skip to content

Commit 4b8d60f

Browse files
authored
Merge pull request #410 from cytopia/php-7-4
Adding PHP-FPM 7.4-dev (Seven Four)
2 parents 528eb45 + a3dcc12 commit 4b8d60f

20 files changed

Lines changed: 381 additions & 8 deletions

.devilbox/www/config.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515

1616
$DEVILBOX_VERSION = 'v0.15';
17-
$DEVILBOX_DATE = '2018-11-02';
17+
$DEVILBOX_DATE = '2018-11-03';
1818
$DEVILBOX_API_PAGE = 'devilbox-api/status.json';
1919

2020
//

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@
6767
/cfg/php-ini-7.1/*.ini
6868
/cfg/php-ini-7.2/*.ini
6969
/cfg/php-ini-7.3/*.ini
70+
/cfg/php-ini-7.4/*.ini
7071

7172
# Ignore custom PHP-FPM configs
7273
/cfg/php-fpm-5.2/php-fpm.xml
@@ -78,6 +79,7 @@
7879
/cfg/php-fpm-7.1/*.conf
7980
/cfg/php-fpm-7.2/*.conf
8081
/cfg/php-fpm-7.3/*.conf
82+
/cfg/php-fpm-7.4/*.conf
8183

8284
# Ignore custom PHP-FPM modules
8385
/mod/php-fpm-5.2/*.so
@@ -89,6 +91,7 @@
8991
/mod/php-fpm-7.1/*.so
9092
/mod/php-fpm-7.2/*.so
9193
/mod/php-fpm-7.3/*.so
94+
/mod/php-fpm-7.4/*.so
9295

9396
# Ignore custom bash and other confi files
9497
/bash/*

.travis.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ env:
5050
- S1=PHP V1=7.1 S2=HTTPD V2=apache-2.2
5151
- S1=PHP V1=7.2 S2=HTTPD V2=apache-2.2
5252
- S1=PHP V1=7.3 S2=HTTPD V2=apache-2.2
53+
- S1=PHP V1=7.4 S2=HTTPD V2=apache-2.2
5354
# PHP vs Apache 2.4
5455
- S1=PHP V1=5.3 S2=HTTPD V2=apache-2.4
5556
- S1=PHP V1=5.4 S2=HTTPD V2=apache-2.4
@@ -59,6 +60,7 @@ env:
5960
- S1=PHP V1=7.1 S2=HTTPD V2=apache-2.4
6061
- S1=PHP V1=7.2 S2=HTTPD V2=apache-2.4
6162
- S1=PHP V1=7.3 S2=HTTPD V2=apache-2.4
63+
- S1=PHP V1=7.4 S2=HTTPD V2=apache-2.4
6264
# PHP vs Nginx stable
6365
- S1=PHP V1=5.3 S2=HTTPD V2=nginx-stable
6466
- S1=PHP V1=5.4 S2=HTTPD V2=nginx-stable
@@ -68,6 +70,7 @@ env:
6870
- S1=PHP V1=7.1 S2=HTTPD V2=nginx-stable
6971
- S1=PHP V1=7.2 S2=HTTPD V2=nginx-stable
7072
- S1=PHP V1=7.3 S2=HTTPD V2=nginx-stable
73+
- S1=PHP V1=7.4 S2=HTTPD V2=nginx-stable
7174
# PHP vs Nginx mainline
7275
- S1=PHP V1=5.3 S2=HTTPD V2=nginx-mainline
7376
- S1=PHP V1=5.4 S2=HTTPD V2=nginx-mainline
@@ -77,6 +80,7 @@ env:
7780
- S1=PHP V1=7.1 S2=HTTPD V2=nginx-mainline
7881
- S1=PHP V1=7.2 S2=HTTPD V2=nginx-mainline
7982
- S1=PHP V1=7.3 S2=HTTPD V2=nginx-mainline
83+
- S1=PHP V1=7.4 S2=HTTPD V2=nginx-mainline
8084

8185
###
8286
### MYSQL

README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -284,12 +284,27 @@ Every single attachable container comes with many different versions. In order t
284284
<td></td>
285285
<td></td>
286286
</tr>
287+
<tr>
288+
<td></td>
289+
<td></td>
290+
<td><a target="_blank" title="PHP 7.4" href="https://github.com/devilbox/docker-php-fpm">7.4</a><sup>[2]</sup></td>
291+
<td></td>
292+
<td></td>
293+
<td></td>
294+
<td></td>
295+
<td></td>
296+
<td></td>
297+
<td></td>
298+
</tr>
287299
</tbody>
288300
</table>
289301

290302
<strong><sup>[1]</sup></strong> <strong>PHP 5.2</strong> is available to use, but it is not officially supported. The Devilbox intranet does not work with this version as PHP 5.2 does not support namespaces.
291303
Furthermore PHP 5.2 does only work with Apache 2.4, Nginx stable and Nginx mainline. It does not work with Apache 2.2. Use at your own risk.
292304

305+
<strong><sup>[2]</sup></strong> <strong>PHP 7.4</strong> is the upcoming unreleased version of PHP, which is directly built out of their [master](https://github.com/php/php-src/) branch.
306+
It will improve every day as the image is rebuilt every day from the latest commits.
307+
293308
> **Documentation:**
294309
> [Change container versions](https://devilbox.readthedocs.io/en/latest/getting-started/change-container-versions.html)
295310

cfg/php-fpm-7.4/.keepme

Whitespace-only changes.

cfg/php-fpm-7.4/README.md

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# PHP-FPM config directory
2+
3+
## General
4+
5+
* Add you custom php-fpm.conf files into this directory.
6+
* Only files ending by `.conf` will be enabled
7+
* Only files ending by `.conf` are ignored by git
8+
9+
10+
## Example files
11+
12+
This directory also holds three example files:
13+
14+
| File | Description |
15+
|---------------------------------|---------------------------------------------|
16+
| `devilbox-fpm.conf-default` | Represents current PHP-FPM default settings |
17+
| `devilbox-fpm.conf-pm_dynamic` | Example settings for dynamic workers |
18+
| `devilbox-fpm.conf-pm_ondemand` | Example settings for ondemand workers |
19+
20+
* Do not edit these example files!
21+
* Copy them to a new file (in case you want to use them)
22+
23+
24+
## Worker configuration
25+
26+
When changing worker processes or scheduler, the following commands will come in handy
27+
to monitor number of processes and memory consumption.
28+
29+
```bash
30+
# Show current PHP-FPM child memory consumption in MB
31+
ps -ylC php-fpm --sort:rss | awk '!/RSS/ { s+=$8 } END { printf "%dM\n", s/1024 }'
32+
33+
# (repeatedly) show current PHP-FPM child memory consumption in MB
34+
watch --interval=1 "ps -ylC php-fpm --sort:rss | awk '"'!'"/RSS/ { s+=\$8 } END { printf \"%dM\n\", s/1024 }'"
35+
36+
# (repeatedly) Current number of PHP-FPM childs
37+
watch --interval=1 "ps auxw | grep -E 'php-(cgi|fpm)' | grep -vE 'grep|master' | wc -l"
38+
```
39+
40+
41+
## Overwriting
42+
43+
If multiple `.conf` files are present in this directory specifying different values for the
44+
same settings, the last file (alphabetically by filename) will overwrite any previous values.
45+
46+
47+
## Compatibility
48+
49+
**Note:**
50+
51+
PHP-FPM 5.2 uses XML-style configuration and does not allow includes.
52+
If you want to change php-fpm.conf for PHP-FPM 5.2 you need to adjust the main configuration file.
53+
54+
See `php-fpm-5.2/` directory.
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
; ############################################################
2+
; Devilbox php-fpm.conf: Current default settings
3+
; ############################################################
4+
;
5+
; Information
6+
; -----------
7+
; * Do not edit this file (it belongs to git)
8+
; * This file shows example settings that are currently effective
9+
; * If this file is enabled, nothing will change as it reflects the current default settings
10+
;
11+
; How to enable?
12+
; --------------
13+
; * Copy this file to another file with ".conf" extension
14+
; * Only files with ".conf" extensions will be applied by PHP-FPM
15+
16+
17+
; ###
18+
; ### PHP-FPM global settings
19+
; ###
20+
;
21+
[global]
22+
23+
; Error log level. Possible values: alert, error, warning, notice, debug. Default value: notice.
24+
log_level = notice
25+
26+
27+
28+
; ###
29+
; ### Pool configuratoin
30+
; ###
31+
32+
[www]
33+
34+
; The timeout for serving a single request after which the worker process will be killed.
35+
; This option should be used when the 'max_execution_time' ini option does not stop script
36+
; execution for some reason.
37+
request_terminate_timeout = 120s
38+
39+
40+
; A maximum of backlog incoming connections will be queued for processing.
41+
; If a connection request arrives with the queue full the client may receive an error with an
42+
; indication of ECONNREFUSED, or, if the underlying protocol supports retransmission,
43+
; the request may be ignored so that retries may succeed.
44+
; This should not be greater than `cat /proc/sys/net/core/somaxconn`, otherwise connections
45+
; are silently truncated
46+
listen.backlog = 1024
47+
48+
49+
; static - the number of child processes is fixed (pm.max_children).
50+
;
51+
; dynamic - the number of child processes is set dynamically based on the following directives:
52+
; pm.max_children, pm.start_servers, pm.min_spare_servers, pm.max_spare_servers.
53+
;
54+
; ondemand - the processes spawn on demand (when requested, as opposed to dynamic, where
55+
; pm.start_servers are started when the service is started.
56+
pm = ondemand
57+
58+
; The maximum number of child processes to be created
59+
pm.max_children = 50
60+
61+
; The number of child processes created on startup. Used only when pm is set to dynamic.
62+
; Default Value: min_spare_servers + (max_spare_servers - min_spare_servers) / 2.
63+
pm.start_servers = 4
64+
65+
; The desired minimum number of idle server processes.
66+
pm.min_spare_servers = 2
67+
68+
; The desired maximum number of idle server processes.
69+
pm.max_spare_servers = 6
70+
71+
; The number of requests each child process should execute before respawning.
72+
; This can be useful to work around memory leaks in 3rd party libraries.
73+
; For endless request processing specify '0'. Equivalent to PHP_FCGI_MAX_REQUESTS.
74+
; Default value: 0.
75+
pm.max_requests = 500
76+
77+
; The number of seconds after which an idle process will be killed. Used only when pm is set to ondemand
78+
pm.process_idle_timeout = 10s
79+
80+
; vim: set ft=dosini:
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
; ############################################################
2+
; # Devilbox php-fpm.conf: dynamic example
3+
; ############################################################
4+
;
5+
; Information
6+
; -----------
7+
; * Do not edit this file (it belongs to git)
8+
; * This file show a possible dynamic example configuration
9+
; * If this file is enabled, it will overwrite the current worker settings
10+
;
11+
; How to enable?
12+
; --------------
13+
; * Copy this file to another file with ".conf" extension
14+
; * Only files with ".conf" extensions will be applied by PHP-FPM
15+
16+
17+
; ###
18+
; ### Pool configuratoin
19+
; ###
20+
21+
[www]
22+
23+
; dynamic - the number of child processes is set dynamically based on the following directives:
24+
pm = dynamic
25+
26+
; The maximum number of child processes to be created
27+
pm.max_children = 50
28+
29+
; The number of child processes created on startup. Used only when pm is set to dynamic.
30+
; Default Value: min_spare_servers + (max_spare_servers - min_spare_servers) / 2.
31+
pm.start_servers = 4
32+
33+
; The desired minimum number of idle server processes.
34+
pm.min_spare_servers = 2
35+
36+
; The desired maximum number of idle server processes.
37+
pm.max_spare_servers = 6
38+
39+
; The number of requests each child process should execute before respawning.
40+
; This can be useful to work around memory leaks in 3rd party libraries.
41+
; For endless request processing specify '0'. Equivalent to PHP_FCGI_MAX_REQUESTS.
42+
; Default value: 0.
43+
pm.max_requests = 500
44+
45+
46+
; vim: set ft=dosini:
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
; ############################################################
2+
; # Devilbox php-fpm.conf: ondemand example
3+
; ############################################################
4+
;
5+
; Information
6+
; -----------
7+
; * Do not edit this file (it belongs to git)
8+
; * This file show a possible ondemand example configuration
9+
; * If this file is enabled, it will overwrite the current worker settings
10+
;
11+
; How to enable?
12+
; --------------
13+
; * Copy this file to another file with ".conf" extension
14+
; * Only files with ".conf" extensions will be applied by PHP-FPM
15+
16+
17+
; ###
18+
; ### Pool configuratoin
19+
; ###
20+
21+
[www]
22+
23+
; ondemand - the processes spawn on demand (when requested, as opposed to dynamic, where
24+
; pm.start_servers are started when the service is started.
25+
pm = ondemand
26+
27+
; The maximum number of child processes to be created
28+
pm.max_children = 50
29+
30+
; The number of requests each child process should execute before respawning.
31+
; This can be useful to work around memory leaks in 3rd party libraries.
32+
; For endless request processing specify '0'. Equivalent to PHP_FCGI_MAX_REQUESTS.
33+
; Default value: 0.
34+
pm.max_requests = 500
35+
36+
; The number of seconds after which an idle process will be killed.
37+
pm.process_idle_timeout = 10s
38+
39+
; vim: set ft=dosini:

cfg/php-ini-7.4/.keepme

Whitespace-only changes.

0 commit comments

Comments
 (0)