Skip to content

Commit 8c991a7

Browse files
committed
Support for PHP 8.3
1 parent bf7226e commit 8c991a7

8 files changed

Lines changed: 387 additions & 4 deletions

File tree

install

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ apt-get -qq install php7.4-xdebug
1010
apt-get -qq install php8.0-xdebug
1111
apt-get -qq install php8.1-xdebug
1212
apt-get -qq install php8.2-xdebug
13+
apt-get -qq install php8.3-xdebug
1314

1415
# Copy PHP profiles to PHP Xdebug versions
1516
mkdir /etc/php/7.4xdbg
@@ -32,12 +33,18 @@ rsync -al /etc/php/8.2/ /etc/php/8.2xdbg
3233
rm -rf /etc/php/8.2xdbg/fpm/pool.d
3334
./link_rename.sh /etc/php/8.2xdbg/fpm/conf.d /etc/php/8.2/ /etc/php/8.2xdbg/
3435
ln -s /etc/php/8.2xdbg/mods-available/xdebug.ini /etc/php/8.2xdbg/fpm/conf.d/20-xdebug.ini
36+
mkdir /etc/php/8.3xdbg
37+
rsync -al /etc/php/8.3/ /etc/php/8.3xdbg
38+
rm -rf /etc/php/8.3xdbg/fpm/pool.d
39+
./link_rename.sh /etc/php/8.3xdbg/fpm/conf.d /etc/php/8.3/ /etc/php/8.3xdbg/
40+
ln -s /etc/php/8.3xdbg/mods-available/xdebug.ini /etc/php/8.3xdbg/fpm/conf.d/20-xdebug.ini
3541

3642
# Remove xdebug from plain PHP versions
3743
rm -f /etc/php/7.4/fpm/conf.d/20-xdebug.ini
3844
rm -f /etc/php/8.0/fpm/conf.d/20-xdebug.ini
3945
rm -f /etc/php/8.1/fpm/conf.d/20-xdebug.ini
4046
rm -f /etc/php/8.2/fpm/conf.d/20-xdebug.ini
47+
rm -f /etc/php/8.3/fpm/conf.d/20-xdebug.ini
4148
rsync -r ./src/etc/php/ /etc/php/
4249
rsync -r ./src/etc/init.d/ /etc/init.d/
4350
rsync -r ./src/lib/systemd/system/ /lib/systemd/system/
@@ -47,12 +54,14 @@ chmod +x /etc/init.d/php7.4xdbg-fpm
4754
chmod +x /etc/init.d/php8.0xdbg-fpm
4855
chmod +x /etc/init.d/php8.1xdbg-fpm
4956
chmod +x /etc/init.d/php8.2xdbg-fpm
57+
chmod +x /etc/init.d/php8.3xdbg-fpm
5058

5159
# Add to auto start
5260
systemctl enable php7.4xdbg-fpm
5361
systemctl enable php8.0xdbg-fpm
5462
systemctl enable php8.1xdbg-fpm
5563
systemctl enable php8.2xdbg-fpm
64+
systemctl enable php8.3xdbg-fpm
5665

5766

5867
############################################

src/etc/init.d/php8-3xdbg-fpm

Lines changed: 162 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,162 @@
1+
#!/bin/sh
2+
### BEGIN INIT INFO
3+
# Provides: php8.3xdbg-fpm
4+
# Required-Start: $remote_fs $network
5+
# Required-Stop: $remote_fs $network
6+
# Default-Start: 2 3 4 5
7+
# Default-Stop: 0 1 6
8+
# Short-Description: starts php8.3xdbg-fpm
9+
# Description: Starts The PHP Xdebug FastCGI Process Manager Daemon
10+
### END INIT INFO
11+
12+
# Author: Stephen J. Carnam <steveorevo@gmail.com>
13+
export PHPRC=/etc/php/8.3xdbg/fpm
14+
export PHP_INI_SCAN_DIR=/etc/php/8.3xdbg/fpm/conf.d
15+
PATH=/sbin:/usr/sbin:/bin:/usr/bin
16+
DESC="PHP 8.3 Xdebug FastCGI Process Manager"
17+
NAME=php-fpm8.3
18+
CONFFILE=/etc/php/8.3xdbg/fpm/php-fpm.conf
19+
DAEMON=/usr/sbin/$NAME
20+
DAEMON_ARGS="--daemonize --fpm-config $CONFFILE"
21+
CONF_PIDFILE=$(sed -n 's/^pid[ =]*//p' $CONFFILE)
22+
PIDFILE=${CONF_PIDFILE:-/run/php/php8.3xdbg-fpm.pid}
23+
TIMEOUT=30
24+
SCRIPTNAME=/etc/init.d/$NAME
25+
26+
# Exit if the package is not installed
27+
[ -x "$DAEMON" ] || exit 0
28+
29+
# Read configuration variable file if it is present
30+
[ -r /etc/default/$NAME ] && . /etc/default/$NAME
31+
32+
# Load the VERBOSE setting and other rcS variables
33+
. /lib/init/vars.sh
34+
35+
# Define LSB log_* functions.
36+
# Depend on lsb-base (>= 3.0-6) to ensure that this file is present.
37+
. /lib/lsb/init-functions
38+
39+
#
40+
# Function that starts the daemon/service
41+
#
42+
do_start()
43+
{
44+
# Return
45+
# 0 if daemon has been started
46+
# 1 if daemon was already running
47+
# 2 if daemon could not be started
48+
start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON --test > /dev/null \
49+
|| return 1
50+
start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON -- \
51+
$DAEMON_ARGS 2>/dev/null \
52+
|| return 2
53+
# Add code here, if necessary, that waits for the process to be ready
54+
# to handle requests from services started subsequently which depend
55+
# on this one. As a last resort, sleep for some time.
56+
}
57+
58+
#
59+
# Function that stops the daemon/service
60+
#
61+
do_stop()
62+
{
63+
# Return
64+
# 0 if daemon has been stopped
65+
# 1 if daemon was already stopped
66+
# 2 if daemon could not be stopped
67+
# other if a failure occurred
68+
start-stop-daemon --stop --quiet --retry=QUIT/$TIMEOUT/TERM/5/KILL/5 --pidfile $PIDFILE --name $NAME
69+
RETVAL="$?"
70+
[ "$RETVAL" = 2 ] && return 2
71+
# Wait for children to finish too if this is a daemon that forks
72+
# and if the daemon is only ever run from this initscript.
73+
# If the above conditions are not satisfied then add some other code
74+
# that waits for the process to drop all resources that could be
75+
# needed by services started subsequently. A last resort is to
76+
# sleep for some time.
77+
start-stop-daemon --stop --quiet --oknodo --retry=0/30/TERM/5/KILL/5 --exec $DAEMON
78+
[ "$?" = 2 ] && return 2
79+
# Many daemons don't delete their pidfiles when they exit.
80+
rm -f $PIDFILE
81+
return "$RETVAL"
82+
}
83+
84+
#
85+
# Function that sends a SIGHUP to the daemon/service
86+
#
87+
do_reload() {
88+
#
89+
# If the daemon can reload its configuration without
90+
# restarting (for example, when it is sent a SIGHUP),
91+
# then implement that here.
92+
#
93+
start-stop-daemon --stop --signal USR2 --quiet --pidfile $PIDFILE --name $NAME
94+
return 0
95+
}
96+
97+
case "$1" in
98+
start)
99+
[ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME"
100+
systemd-tmpfiles --remove --create /usr/lib/tmpfiles.d/php8.3xdbg-fpm.conf
101+
case "$?" in
102+
0)
103+
do_start
104+
case "$?" in
105+
0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
106+
2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
107+
esac
108+
;;
109+
1) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
110+
esac
111+
;;
112+
stop)
113+
[ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME"
114+
do_stop
115+
case "$?" in
116+
0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
117+
2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
118+
esac
119+
;;
120+
status)
121+
status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $?
122+
;;
123+
reload|force-reload)
124+
log_daemon_msg "Reloading $DESC" "$NAME"
125+
do_reload
126+
log_end_msg $?
127+
;;
128+
reopen-logs)
129+
log_daemon_msg "Reopening $DESC logs" $NAME
130+
if start-stop-daemon --stop --signal USR1 --oknodo --quiet \
131+
--pidfile $PIDFILE --exec $DAEMON
132+
then
133+
log_end_msg 0
134+
else
135+
log_end_msg 1
136+
fi
137+
;;
138+
restart)
139+
log_daemon_msg "Restarting $DESC" "$NAME"
140+
do_stop
141+
case "$?" in
142+
0|1)
143+
do_start
144+
case "$?" in
145+
0) log_end_msg 0 ;;
146+
1) log_end_msg 1 ;; # Old process is still running
147+
*) log_end_msg 1 ;; # Failed to start
148+
esac
149+
;;
150+
*)
151+
# Failed to stop
152+
log_end_msg 1
153+
;;
154+
esac
155+
;;
156+
*)
157+
echo "Usage: $SCRIPTNAME {start|stop|status|restart|reload|force-reload}" >&2
158+
exit 1
159+
;;
160+
esac
161+
162+
:
Lines changed: 145 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,145 @@
1+
;;;;;;;;;;;;;;;;;;;;;
2+
; FPM Configuration ;
3+
;;;;;;;;;;;;;;;;;;;;;
4+
5+
; All relative paths in this configuration file are relative to PHP's install
6+
; prefix (/usr). 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 /var
16+
; Default Value: none
17+
; Warning: if you change the value here, you need to modify systemd
18+
; service PIDFile= setting to match the value here.
19+
pid = /run/php/php8.3xdbg-fpm.pid
20+
21+
; Error log file
22+
; If it's set to "syslog", log is sent to syslogd instead of being written
23+
; into a local file.
24+
; Note: the default prefix is /var
25+
; Default Value: log/php-fpm.log
26+
error_log = /var/log/php8.3xdbg-fpm.log
27+
28+
; syslog_facility is used to specify what type of program is logging the
29+
; message. This lets syslogd specify that messages from different facilities
30+
; will be handled differently.
31+
; See syslog(3) for possible values (ex daemon equiv LOG_DAEMON)
32+
; Default Value: daemon
33+
;syslog.facility = daemon
34+
35+
; syslog_ident is prepended to every message. If you have multiple FPM
36+
; instances running on the same server, you can change the default value
37+
; which must suit common needs.
38+
; Default Value: php-fpm
39+
;syslog.ident = php$8.3-fpm
40+
41+
; Log level
42+
; Possible Values: alert, error, warning, notice, debug
43+
; Default Value: notice
44+
log_level = error
45+
46+
; Log limit on number of characters in the single line (log entry). If the
47+
; line is over the limit, it is wrapped on multiple lines. The limit is for
48+
; all logged characters including message prefix and suffix if present. However
49+
; the new line character does not count into it as it is present only when
50+
; logging to a file descriptor. It means the new line character is not present
51+
; when logging to syslog.
52+
; Default Value: 1024
53+
;log_limit = 4096
54+
55+
; Log buffering specifies if the log line is buffered which means that the
56+
; line is written in a single write operation. If the value is false, then the
57+
; data is written directly into the file descriptor. It is an experimental
58+
; option that can potentially improve logging performance and memory usage
59+
; for some heavy logging scenarios. This option is ignored if logging to syslog
60+
; as it has to be always buffered.
61+
; Default value: yes
62+
;log_buffering = no
63+
64+
; If this number of child processes exit with SIGSEGV or SIGBUS within the time
65+
; interval set by emergency_restart_interval then FPM will restart. A value
66+
; of '0' means 'Off'.
67+
; Default Value: 0
68+
emergency_restart_threshold = 10
69+
70+
; Interval of time used by emergency_restart_interval to determine when
71+
; a graceful restart will be initiated. This can be useful to work around
72+
; accidental corruptions in an accelerator's shared memory.
73+
; Available Units: s(econds), m(inutes), h(ours), or d(ays)
74+
; Default Unit: seconds
75+
; Default Value: 0
76+
emergency_restart_interval = 60s
77+
78+
; Time limit for child processes to wait for a reaction on signals from master.
79+
; Available units: s(econds), m(inutes), h(ours), or d(ays)
80+
; Default Unit: seconds
81+
; Default Value: 0
82+
process_control_timeout = 10s
83+
84+
; The maximum number of processes FPM will fork. This has been designed to control
85+
; the global number of processes when using dynamic PM within a lot of pools.
86+
; Use it with caution.
87+
; Note: A value of 0 indicates no limit
88+
; Default Value: 0
89+
; process.max = 128
90+
91+
; Specify the nice(2) priority to apply to the master process (only if set)
92+
; The value can vary from -19 (highest priority) to 20 (lowest priority)
93+
; Note: - It will only work if the FPM master process is launched as root
94+
; - The pool process will inherit the master process priority
95+
; unless specified otherwise
96+
; Default Value: no set
97+
; process.priority = -19
98+
99+
; Send FPM to background. Set to 'no' to keep FPM in foreground for debugging.
100+
; Default Value: yes
101+
;daemonize = yes
102+
103+
; Set open file descriptor rlimit for the master process.
104+
; Default Value: system defined value
105+
;rlimit_files = 1024
106+
107+
; Set max core size rlimit for the master process.
108+
; Possible Values: 'unlimited' or an integer greater or equal to 0
109+
; Default Value: system defined value
110+
;rlimit_core = 0
111+
112+
; Specify the event mechanism FPM will use. The following is available:
113+
; - select (any POSIX os)
114+
; - poll (any POSIX os)
115+
; - epoll (linux >= 2.5.44)
116+
; - kqueue (FreeBSD >= 4.1, OpenBSD >= 2.9, NetBSD >= 2.0)
117+
; - /dev/poll (Solaris >= 7)
118+
; - port (Solaris >= 10)
119+
; Default Value: not set (auto detection)
120+
events.mechanism = epoll
121+
122+
; When FPM is built with systemd integration, specify the interval,
123+
; in seconds, between health report notification to systemd.
124+
; Set to 0 to disable.
125+
; Available Units: s(econds), m(inutes), h(ours)
126+
; Default Unit: seconds
127+
; Default value: 10
128+
;systemd_interval = 10
129+
130+
;;;;;;;;;;;;;;;;;;;;
131+
; Pool Definitions ;
132+
;;;;;;;;;;;;;;;;;;;;
133+
134+
; Multiple pools of child processes may be started with different listening
135+
; ports and different management options. The name of the pool will be
136+
; used in logs and stats. There is no limitation on the number of pools which
137+
; FPM can handle. Your system will tell you anyway :)
138+
139+
; Include one or more files. If glob(3) exists, it is used to include a bunch of
140+
; files from a glob(3) pattern. This directive can be used everywhere in the
141+
; file.
142+
; Relative path can also be used. They will be prefixed by:
143+
; - the global prefix if it's been set (-p argument)
144+
; - /usr otherwise
145+
include=/etc/php/8.3xdbg/fpm/pool.d/*.conf
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
; origin-src: deb/php-fpm/dummy.conf
2+
3+
[www]
4+
listen = 127.0.0.1:9683
5+
listen.allowed_clients = 127.0.0.1
6+
7+
user = www-data
8+
group = www-data
9+
10+
pm = ondemand
11+
pm.max_children = 4
12+
pm.max_requests = 4000
13+
pm.process_idle_timeout = 10s
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
zend_extension=xdebug.so
2+
xdebug.start_with_request=yes
3+
xdebug.mode=debug
4+
xdebug.client_host=localhost
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
[Unit]
2+
Description=The PHP 8.3 Xdebug FastCGI Process Manager
3+
Documentation=man:php-fpm8.3(8)
4+
After=network.target
5+
6+
[Service]
7+
Type=notify
8+
Environment=PHPRC=/etc/php/8.3xdbg/fpm
9+
Environment=PHP_INI_SCAN_DIR=/etc/php/8.3xdbg/fpm/conf.d
10+
ExecStart=/usr/sbin/php-fpm8.3 --nodaemonize --fpm-config /etc/php/8.3xdbg/fpm/php-fpm.conf
11+
ExecStartPost=-/usr/lib/php/php-fpm-socket-helper install /run/php/php-fpm.sock /etc/php/8.3xdbg/fpm/pool.d/www.conf 83
12+
ExecStopPost=-/usr/lib/php/php-fpm-socket-helper remove /run/php/php-fpm.sock /etc/php/8.3xdbg/fpm/pool.d/www.conf 83
13+
ExecReload=/bin/kill -USR2 $MAINPID
14+
15+
[Install]
16+
WantedBy=multi-user.target

0 commit comments

Comments
 (0)