Skip to content

Commit c46d75c

Browse files
committed
[NEW] 7.4
1 parent cf98eb0 commit c46d75c

6 files changed

+2439
-9
lines changed

app-spec-v74.toml

+69
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
kind = "AppSpec"
2+
roles = [100, 101]
3+
type_tags = ["runtime"]
4+
5+
[meta]
6+
id = "sysinner-php74"
7+
name = "PHP 7.4"
8+
version = "1.0"
9+
subtitle = "PHP 7.4 运行环境"
10+
11+
[[packages]]
12+
name = "php74"
13+
version = "7.4"
14+
15+
[[packages]]
16+
name = "php-keeper"
17+
version = "0.10"
18+
19+
20+
[[executors]]
21+
name = "php74-main"
22+
exec_start = """
23+
NAME=php-fpm
24+
25+
if pidof $NAME; then
26+
exit 0
27+
fi
28+
29+
if [ ! -d "/opt/php/php74" ]; then
30+
mkdir -p /opt/php/php74
31+
fi
32+
rsync -av {{.inpack_prefix_php74}}/* /opt/php/php74/
33+
34+
if [ -z "$(pidof php-fpm)" ]; then
35+
{{.inpack_prefix_php_keeper}}/bin/php-keeper --php-init --php-modules mbstring,pdo_mysql,curl,iconv,json --php-fpm-on --app-spec sysinner-php74
36+
fi
37+
{{.inpack_prefix_php_keeper}}/bin/php74-init start
38+
"""
39+
40+
exec_stop = "{{.inpack_prefix_php_keeper}}/bin/php74-init stop"
41+
priority = 3
42+
43+
[executors.plan]
44+
on_tick = 60
45+
46+
[configurator]
47+
name = "cfg/sysinner-php"
48+
49+
[[configurator.fields]]
50+
name = "php_modules"
51+
title = "PHP Modules"
52+
type = 1
53+
default = "mbstring,pdo_mysql,curl,iconv,json"
54+
auto_fill = "defval"
55+
56+
[exp_res]
57+
cpu_min = 2
58+
mem_min = 128
59+
vol_min = 1
60+
61+
[exp_deploy]
62+
rep_min = 1
63+
rep_max = 128
64+
sys_state = 1
65+
66+
[[urls]]
67+
name = "gdoc"
68+
url = "https://www.sysinner.cn/gdoc/view/app-guide/php/v74.md"
69+

inpack-72.spec inpack-72.toml

+12-9
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,22 @@
11
[project]
2-
name = php72
3-
version = 7.2.15
4-
vendor = php.net
5-
homepage = http://php.net
6-
groups = dev/sys-runtime
7-
description = fast, flexible, pragmatic and scripting language that is especially suited to web development
2+
name = "php72"
3+
version = "7.2"
4+
vendor = "php.net"
5+
homepage = "http://php.net"
6+
description = "fast, flexible, pragmatic and scripting language that is especially suited to web development"
7+
groups = ["dev/sys-runtime"]
88

9-
%build
10-
PREFIX="/opt/php/php72"
9+
[files]
1110

11+
[scripts]
12+
build = """
13+
PREFIX="/opt/php/php72"
1214
cd {{.inpack__pack_dir}}/deps
1315
1416
if [ ! -f "php-{{.project__version}}.tar.xz" ]; then
1517
wget http://php.net/distributions/php-{{.project__version}}.tar.xz
1618
fi
19+
1720
if [ ! -d "php-{[.project__version}}" ]; then
1821
tar -pxf php-{{.project__version}}.tar.xz
1922
fi
@@ -97,5 +100,5 @@ find {{.buildroot}}/sbin -type f|xargs strip -s
97100
find {{.buildroot}}/lib/php/extensions -type f -name "*.so"|xargs strip -s
98101
99102
rm -rf {{.inpack__pack_dir}}/deps/php-{{.project__version}}
103+
"""
100104

101-
%files

inpack-74.toml

+97
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
[project]
2+
name = "php74"
3+
version = "7.4.11"
4+
vendor = "php.net"
5+
homepage = "http://php.net"
6+
description = "fast, flexible, pragmatic and scripting language that is especially suited to web development"
7+
groups = ["dev/sys-runtime"]
8+
9+
[files]
10+
11+
[scripts]
12+
build = """
13+
PREFIX="/opt/php/php74"
14+
cd {{.inpack__pack_dir}}/deps
15+
16+
if [ ! -f "php-{{.project__version}}.tar.xz" ]; then
17+
wget http://php.net/distributions/php-{{.project__version}}.tar.xz
18+
fi
19+
20+
if [ ! -d "php-{[.project__version}}" ]; then
21+
tar -pxf php-{{.project__version}}.tar.xz
22+
fi
23+
24+
cd php-{{.project__version}}
25+
26+
./configure --prefix=$PREFIX \
27+
--with-config-file-path=$PREFIX/etc \
28+
--with-config-file-scan-dir=$PREFIX/etc/php.d \
29+
--disable-debug \
30+
--enable-static=yes \
31+
--with-pic \
32+
--disable-rpath \
33+
--without-pear \
34+
--without-gdbm \
35+
--with-openssl \
36+
--with-zlib \
37+
--with-kerberos \
38+
--with-mhash \
39+
--enable-fpm \
40+
--enable-pcntl \
41+
--enable-opcache \
42+
--enable-mbstring=shared \
43+
--enable-mbregex \
44+
--enable-gd=shared \
45+
--with-external-gd \
46+
--with-gmp=shared \
47+
--enable-bcmath=shared \
48+
--with-bz2=shared \
49+
--enable-ctype=shared \
50+
--enable-exif=shared \
51+
--enable-ftp=shared \
52+
--with-gettext=shared \
53+
--with-iconv=shared \
54+
--enable-sockets=shared \
55+
--enable-tokenizer=shared \
56+
--enable-exif=shared \
57+
--enable-ftp=shared \
58+
--with-xmlrpc=shared \
59+
--enable-simplexml=shared \
60+
--enable-xml=shared \
61+
--enable-soap=shared \
62+
--with-xsl=shared \
63+
--enable-pdo=shared \
64+
--enable-mysqlnd=shared \
65+
--with-mysqli=shared,mysqlnd \
66+
--with-pdo-mysql=shared,mysqlnd \
67+
--with-pgsql=shared \
68+
--with-pdo-pgsql=shared \
69+
--with-sqlite3=shared \
70+
--with-pdo-sqlite=shared \
71+
--enable-json=shared \
72+
--enable-intl=shared \
73+
--with-curl=shared \
74+
--with-pspell=shared \
75+
--disable-phar
76+
77+
make -j8
78+
79+
INSTALL_ROOT=build_tmp make install-cli install-fpm install-modules
80+
rm -rf build_tmp$PREFIX/php/man
81+
find build_tmp$PREFIX/lib/php/extensions -type f -name "*.a"|xargs rm -f
82+
83+
rsync -av build_tmp$PREFIX/* {{.buildroot}}/
84+
85+
cd {{.inpack__pack_dir}}
86+
87+
mkdir -p {{.buildroot}}/etc/php.d
88+
install misc/php74/php.ini.default {{.buildroot}}/etc/php.ini.default
89+
install misc/php74/php-fpm.conf.default {{.buildroot}}/etc/php-fpm.conf.default
90+
install misc/php74/php-fpm.d__www.conf.default {{.buildroot}}/etc/php-fpm.d/www.conf.default
91+
92+
find {{.buildroot}}/bin -type f|xargs strip -s
93+
find {{.buildroot}}/sbin -type f|xargs strip -s
94+
find {{.buildroot}}/lib/php/extensions -type f -name "*.so"|xargs strip -s
95+
96+
rm -rf {{.inpack__pack_dir}}/deps/php-{{.project__version}}
97+
"""

misc/php74/php-fpm.conf.default

+137
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,137 @@
1+
;;;;;;;;;;;;;;;;;;;;;
2+
; FPM Configuration ;
3+
;;;;;;;;;;;;;;;;;;;;;
4+
5+
; All relative paths in this configuration file are relative to PHP's install
6+
; prefix (/opt/php/php74). This prefix can be dynamically changed by using the
7+
; '-p' argument from the command line.
8+
9+
;;;;;;;;;;;;;;;;;;
10+
; Global Options ;
11+
;;;;;;;;;;;;;;;;;;
12+
13+
[global]
14+
; Pid file
15+
; Note: the default prefix is /opt/php/php74/var
16+
; Default Value: none
17+
;pid = run/php-fpm.pid
18+
19+
; Error log file
20+
; If it's set to "syslog", log is sent to syslogd instead of being written
21+
; into a local file.
22+
; Note: the default prefix is /opt/php/php74/var
23+
; Default Value: log/php-fpm.log
24+
;error_log = log/php-fpm.log
25+
26+
; syslog_facility is used to specify what type of program is logging the
27+
; message. This lets syslogd specify that messages from different facilities
28+
; will be handled differently.
29+
; See syslog(3) for possible values (ex daemon equiv LOG_DAEMON)
30+
; Default Value: daemon
31+
;syslog.facility = daemon
32+
33+
; syslog_ident is prepended to every message. If you have multiple FPM
34+
; instances running on the same server, you can change the default value
35+
; which must suit common needs.
36+
; Default Value: php-fpm
37+
;syslog.ident = php-fpm
38+
39+
; Log level
40+
; Possible Values: alert, error, warning, notice, debug
41+
; Default Value: notice
42+
;log_level = notice
43+
44+
; Log limit on number of characters in the single line (log entry). If the
45+
; line is over the limit, it is wrapped on multiple lines. The limit is for
46+
; all logged characters including message prefix and suffix if present. However
47+
; the new line character does not count into it as it is present only when
48+
; logging to a file descriptor. It means the new line character is not present
49+
; when logging to syslog.
50+
; Default Value: 1024
51+
;log_limit = 4096
52+
53+
; Log buffering specifies if the log line is buffered which means that the
54+
; line is written in a single write operation. If the value is false, then the
55+
; data is written directly into the file descriptor. It is an experimental
56+
; option that can potentionaly improve logging performance and memory usage
57+
; for some heavy logging scenarios. This option is ignored if logging to syslog
58+
; as it has to be always buffered.
59+
; Default value: yes
60+
;log_buffering = no
61+
62+
; If this number of child processes exit with SIGSEGV or SIGBUS within the time
63+
; interval set by emergency_restart_interval then FPM will restart. A value
64+
; of '0' means 'Off'.
65+
; Default Value: 0
66+
;emergency_restart_threshold = 0
67+
68+
; Interval of time used by emergency_restart_interval to determine when
69+
; a graceful restart will be initiated. This can be useful to work around
70+
; accidental corruptions in an accelerator's shared memory.
71+
; Available Units: s(econds), m(inutes), h(ours), or d(ays)
72+
; Default Unit: seconds
73+
; Default Value: 0
74+
;emergency_restart_interval = 0
75+
76+
; Time limit for child processes to wait for a reaction on signals from master.
77+
; Available units: s(econds), m(inutes), h(ours), or d(ays)
78+
; Default Unit: seconds
79+
; Default Value: 0
80+
;process_control_timeout = 0
81+
82+
; The maximum number of processes FPM will fork. This has been designed to control
83+
; the global number of processes when using dynamic PM within a lot of pools.
84+
; Use it with caution.
85+
; Note: A value of 0 indicates no limit
86+
; Default Value: 0
87+
;process.max = 128
88+
89+
; Specify the nice(2) priority to apply to the master process (only if set)
90+
; The value can vary from -19 (highest priority) to 20 (lowest priority)
91+
; Note: - It will only work if the FPM master process is launched as root
92+
; - The pool process will inherit the master process priority
93+
; unless specified otherwise
94+
; Default Value: no set
95+
;process.priority = -19
96+
97+
; Send FPM to background. Set to 'no' to keep FPM in foreground for debugging.
98+
; Default Value: yes
99+
daemonize = yes
100+
101+
; Set open file descriptor rlimit for the master process.
102+
; Default Value: system defined value
103+
;rlimit_files = 1024
104+
105+
; Set max core size rlimit for the master process.
106+
; Possible Values: 'unlimited' or an integer greater or equal to 0
107+
; Default Value: system defined value
108+
;rlimit_core = 0
109+
110+
; Specify the event mechanism FPM will use. The following is available:
111+
; - select (any POSIX os)
112+
; - poll (any POSIX os)
113+
; - epoll (linux >= 2.5.44)
114+
; Default Value: not set (auto detection)
115+
;events.mechanism = epoll
116+
117+
; When FPM is built with systemd integration, specify the interval,
118+
; in seconds, between health report notification to systemd.
119+
; Set to 0 to disable.
120+
; Available Units: s(econds), m(inutes), h(ours)
121+
; Default Unit: seconds
122+
; Default value: 10
123+
;systemd_interval = 10
124+
125+
;;;;;;;;;;;;;;;;;;;;
126+
; Pool Definitions ;
127+
;;;;;;;;;;;;;;;;;;;;
128+
129+
; Multiple pools of child processes may be started with different listening
130+
; ports and different management options. The name of the pool will be
131+
; used in logs and stats. There is no limitation on the number of pools which
132+
; FPM can handle. Your system will tell you anyway :)
133+
134+
; See etc/php-fpm.d/*.conf
135+
136+
include=/opt/php/php74/etc/php-fpm.d/*.conf
137+

0 commit comments

Comments
 (0)