This repository was archived by the owner on Aug 11, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy path0001-php-fpm-default-to-ondemand-policy-change-some-defau.patch
More file actions
86 lines (80 loc) · 2.84 KB
/
0001-php-fpm-default-to-ondemand-policy-change-some-defau.patch
File metadata and controls
86 lines (80 loc) · 2.84 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
From 84871881f028dfd569bc97c836429a41eca8dff8 Mon Sep 17 00:00:00 2001
From: Arjan van de Ven <[email protected]>
Date: Thu, 23 Jan 2020 12:34:40 -0800
Subject: [PATCH 1/5] php-fpm: default to ondemand policy, change some
defaults.
---
config/php-fpm.service | 13 +++++++++++++
config/php-httpd.conf | 11 +++++++++++
sapi/fpm/www.conf.in | 8 ++++----
3 files changed, 28 insertions(+), 4 deletions(-)
create mode 100644 config/php-fpm.service
create mode 100644 config/php-httpd.conf
diff --git a/config/php-fpm.service b/config/php-fpm.service
new file mode 100644
index 00000000..8764e2e9
--- /dev/null
+++ b/config/php-fpm.service
@@ -0,0 +1,13 @@
+[Unit]
+Description=The PHP FastCGI Process Manager
+After=syslog.target network.target
+
+[Service]
+Type=notify
+PIDFile=/run/php-fpm.pid
+ExecStart=/usr/sbin/php-fpm --nodaemonize
+ExecReload=/bin/kill -USR2 $MAINPID
+PrivateTmp=true
+
+[Install]
+WantedBy=multi-user.target
diff --git a/config/php-httpd.conf b/config/php-httpd.conf
new file mode 100644
index 00000000..3c6736de
--- /dev/null
+++ b/config/php-httpd.conf
@@ -0,0 +1,11 @@
+# Enable php-fpm proxy on port 9000
+LoadModule proxy_module /usr/lib/httpd/modules/mod_proxy.so
+LoadModule proxy_fcgi_module /usr/lib/httpd/modules/mod_proxy_fcgi.so
+<FilesMatch \.php$>
+ SetHandler "proxy:unix:/run/php-fpm.sock|fcgi://127.0.0.1"
+</FilesMatch>
+
+# Override default directory index to include index.php
+<IfModule dir_module>
+ DirectoryIndex index.html index.php
+</IfModule>
diff --git a/sapi/fpm/www.conf.in b/sapi/fpm/www.conf.in
index 169d1956..1e0df93d 100644
--- a/sapi/fpm/www.conf.in
+++ b/sapi/fpm/www.conf.in
@@ -33,7 +33,7 @@ group = @php_fpm_group@
; (IPv6 and IPv4-mapped) on a specific port;
; '/path/to/unix/socket' - to listen on a unix socket.
; Note: This value is mandatory.
-listen = 127.0.0.1:9000
+listen = /run/php-fpm.sock
; Set listen(2) backlog.
; Default Value: 511 (-1 on FreeBSD and OpenBSD)
@@ -45,8 +45,8 @@ listen = 127.0.0.1:9000
; Default Values: Owner is set to the master process running user. If the group
; is not set, the owner's group is used. Mode is set to 0660.
;listen.owner = @php_fpm_user@
-;listen.group = @php_fpm_group@
-;listen.mode = 0660
+listen.group = httpd
+listen.mode = 0660
; When POSIX Access Control Lists are supported you can set them using
; these options, value is a comma separated list of user/group names.
@@ -99,7 +99,7 @@ listen = 127.0.0.1:9000
; pm.process_idle_timeout - The number of seconds after which
; an idle process will be killed.
; Note: This value is mandatory.
-pm = dynamic
+pm = ondemand
; The number of child processes to be created when pm is set to 'static' and the
; maximum number of child processes when pm is set to 'dynamic' or 'ondemand'.
--
2.25.0