Skip to content

Commit 2f79dcd

Browse files
authored
Add support PHP8.1 (hestiacp#2233)
* Add support for PHP-8.1 * Add support for php 8.1 * Update /edit/server/index.php with php version * Add support for tests
1 parent 5b20478 commit 2f79dcd

28 files changed

+478
-11
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Hestia Control Panel is designed to provide administrators an easy to use web an
1919
Features and Services
2020
----------------------------
2121
* Apache2 and NGINX with PHP-FPM
22-
* Multiple PHP versions (5.6 - 8.0, 7.4 as default)
22+
* Multiple PHP versions (5.6 - 8.1, 8.0 as default)
2323
* DNS Server (Bind) with clustering capabilities
2424
* POP/IMAP/SMTP mail services with Anti-Virus, Anti-Spam, and Webmail (ClamAV, SpamAssassin, Roundcube, Rainloop)
2525
* MariaDB and/or PostgreSQL databases

bin/v-restart-service

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ for service in $service_list; do
6969
"$service" = "php7.3-fpm" -o \
7070
"$service" = "php7.4-fpm" -o \
7171
"$service" = "php8.0-fpm" -o \
72+
"$service" = "php8.1-fpm" -o \
7273
"$service" = "proftpd" -o \
7374
"$service" = "ssh" -o \
7475
"$service" = "fail2ban" ]; then

install/deb/multiphp/apache2/PHP-56.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ pool_file_72="/etc/php/7.2/fpm/pool.d/$2.conf"
4646
pool_file_73="/etc/php/7.3/fpm/pool.d/$2.conf"
4747
pool_file_74="/etc/php/7.4/fpm/pool.d/$2.conf"
4848
pool_file_80="/etc/php/8.0/fpm/pool.d/$2.conf"
49+
pool_file_81="/etc/php/8.1/fpm/pool.d/$2.conf"
4950

5051
if [ ! -f "$pool_file_56" ]; then
5152
echo "$pool_conf" > $pool_file_56
@@ -82,4 +83,9 @@ if [ -f "$pool_file_80" ]; then
8283
service php8.0-fpm restart
8384
fi
8485

86+
if [ -f "$pool_file_81" ]; then
87+
rm $pool_file_81
88+
service php8.1-fpm restart
89+
fi
90+
8591
exit 0

install/deb/multiphp/apache2/PHP-70.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ pool_file_72="/etc/php/7.2/fpm/pool.d/$2.conf"
4646
pool_file_73="/etc/php/7.3/fpm/pool.d/$2.conf"
4747
pool_file_74="/etc/php/7.4/fpm/pool.d/$2.conf"
4848
pool_file_80="/etc/php/8.0/fpm/pool.d/$2.conf"
49+
pool_file_81="/etc/php/8.1/fpm/pool.d/$2.conf"
4950

5051
if [ -f "$pool_file_56" ]; then
5152
rm $pool_file_56
@@ -82,4 +83,9 @@ if [ -f "$pool_file_80" ]; then
8283
service php8.0-fpm restart
8384
fi
8485

86+
if [ -f "$pool_file_81" ]; then
87+
rm $pool_file_81
88+
service php8.1-fpm restart
89+
fi
90+
8591
exit 0

install/deb/multiphp/apache2/PHP-71.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ pool_file_72="/etc/php/7.2/fpm/pool.d/$2.conf"
4646
pool_file_73="/etc/php/7.3/fpm/pool.d/$2.conf"
4747
pool_file_74="/etc/php/7.4/fpm/pool.d/$2.conf"
4848
pool_file_80="/etc/php/8.0/fpm/pool.d/$2.conf"
49+
pool_file_81="/etc/php/8.1/fpm/pool.d/$2.conf"
4950

5051
if [ -f "$pool_file_56" ]; then
5152
rm $pool_file_56
@@ -82,4 +83,9 @@ if [ -f "$pool_file_80" ]; then
8283
service php8.0-fpm restart
8384
fi
8485

86+
if [ -f "$pool_file_81" ]; then
87+
rm $pool_file_81
88+
service php8.1-fpm restart
89+
fi
90+
8591
exit 0

install/deb/multiphp/apache2/PHP-72.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ pool_file_72="/etc/php/7.2/fpm/pool.d/$2.conf"
4646
pool_file_73="/etc/php/7.3/fpm/pool.d/$2.conf"
4747
pool_file_74="/etc/php/7.4/fpm/pool.d/$2.conf"
4848
pool_file_80="/etc/php/8.0/fpm/pool.d/$2.conf"
49+
pool_file_81="/etc/php/8.1/fpm/pool.d/$2.conf"
4950

5051
if [ -f "$pool_file_56" ]; then
5152
rm $pool_file_56
@@ -82,4 +83,9 @@ if [ -f "$pool_file_80" ]; then
8283
service php8.0-fpm restart
8384
fi
8485

86+
if [ -f "$pool_file_81" ]; then
87+
rm $pool_file_81
88+
service php8.1-fpm restart
89+
fi
90+
8591
exit 0

install/deb/multiphp/apache2/PHP-73.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ pool_file_72="/etc/php/7.2/fpm/pool.d/$2.conf"
4646
pool_file_73="/etc/php/7.3/fpm/pool.d/$2.conf"
4747
pool_file_74="/etc/php/7.4/fpm/pool.d/$2.conf"
4848
pool_file_80="/etc/php/8.0/fpm/pool.d/$2.conf"
49+
pool_file_81="/etc/php/8.1/fpm/pool.d/$2.conf"
4950

5051
if [ -f "$pool_file_56" ]; then
5152
rm $pool_file_56
@@ -82,4 +83,9 @@ if [ -f "$pool_file_80" ]; then
8283
service php8.0-fpm restart
8384
fi
8485

86+
if [ -f "$pool_file_81" ]; then
87+
rm $pool_file_81
88+
service php8.1-fpm restart
89+
fi
90+
8591
exit 0

install/deb/multiphp/apache2/PHP-74.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ pool_file_72="/etc/php/7.2/fpm/pool.d/$2.conf"
4646
pool_file_73="/etc/php/7.3/fpm/pool.d/$2.conf"
4747
pool_file_74="/etc/php/7.4/fpm/pool.d/$2.conf"
4848
pool_file_80="/etc/php/8.0/fpm/pool.d/$2.conf"
49+
pool_file_81="/etc/php/8.1/fpm/pool.d/$2.conf"
50+
4951

5052
if [ -f "$pool_file_56" ]; then
5153
rm $pool_file_56
@@ -82,4 +84,9 @@ if [ -f "$pool_file_80" ]; then
8284
service php8.0-fpm restart
8385
fi
8486

87+
if [ -f "$pool_file_81" ]; then
88+
rm $pool_file_81
89+
service php8.1-fpm restart
90+
fi
91+
8592
exit 0

install/deb/multiphp/apache2/PHP-80.sh

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ pool_file_72="/etc/php/7.2/fpm/pool.d/$2.conf"
4646
pool_file_73="/etc/php/7.3/fpm/pool.d/$2.conf"
4747
pool_file_74="/etc/php/7.4/fpm/pool.d/$2.conf"
4848
pool_file_80="/etc/php/8.0/fpm/pool.d/$2.conf"
49+
pool_file_81="/etc/php/8.1/fpm/pool.d/$2.conf"
4950

5051
if [ -f "$pool_file_56" ]; then
5152
rm $pool_file_56
@@ -72,14 +73,19 @@ if [ -f "$pool_file_73" ]; then
7273
service php7.3-fpm restart
7374
fi
7475

75-
if [ ! -f "$pool_file_74" ]; then
76-
echo "$pool_conf" > $pool_file_74
76+
if [ -f "$pool_file_74" ]; then
77+
rm $pool_file_74
7778
service php7.4-fpm restart
7879
fi
7980

80-
if [ -f "$pool_file_80" ]; then
81+
if [ ! -f "$pool_file_80" ]; then
8182
echo "$pool_conf" > $pool_file_80
8283
service php8.0-fpm restart
8384
fi
8485

86+
if [ -f "$pool_file_81" ]; then
87+
rm $pool_file_81
88+
service php8.1-fpm restart
89+
fi
90+
8591
exit 0
Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
#!/bin/bash
2+
# Adding php pool conf
3+
user="$1"
4+
domain="$2"
5+
ip="$3"
6+
home_dir="$4"
7+
docroot="$5"
8+
9+
pool_conf="[$2]
10+
11+
listen = /run/php/php8.0-fpm-$2.sock
12+
listen.owner = $1
13+
listen.group = www-data
14+
listen.mode = 0660
15+
16+
user = $1
17+
group = $1
18+
19+
pm = ondemand
20+
pm.max_children = 8
21+
pm.max_requests = 4000
22+
pm.process_idle_timeout = 10s
23+
pm.status_path = /status
24+
25+
php_admin_value[upload_tmp_dir] = /home/$1/tmp
26+
php_admin_value[session.save_path] = /home/$1/tmp
27+
php_admin_value[open_basedir] = $5:/home/$1/tmp:/bin:/usr/bin:/usr/local/bin:/var/www/html:/tmp:/usr/share:/etc/phpMyAdmin:/etc/phpmyadmin:/var/lib/phpmyadmin:/etc/roundcubemail
28+
php_admin_value[upload_max_filesize] = 80M
29+
php_admin_value[max_execution_time] = 20
30+
php_admin_value[post_max_size] = 80M
31+
php_admin_value[memory_limit] = 256M
32+
php_admin_value[sendmail_path] = /usr/sbin/sendmail -t -i -f info@$2
33+
php_admin_flag[mysql.allow_persistent] = off
34+
php_admin_flag[safe_mode] = off
35+
36+
env[PATH] = /usr/local/bin:/usr/bin:/bin
37+
env[TMP] = /home/$1/tmp
38+
env[TMPDIR] = /home/$1/tmp
39+
env[TEMP] = /home/$1/tmp
40+
"
41+
42+
pool_file_56="/etc/php/5.6/fpm/pool.d/$2.conf"
43+
pool_file_70="/etc/php/7.0/fpm/pool.d/$2.conf"
44+
pool_file_71="/etc/php/7.1/fpm/pool.d/$2.conf"
45+
pool_file_72="/etc/php/7.2/fpm/pool.d/$2.conf"
46+
pool_file_73="/etc/php/7.3/fpm/pool.d/$2.conf"
47+
pool_file_74="/etc/php/7.4/fpm/pool.d/$2.conf"
48+
pool_file_80="/etc/php/8.0/fpm/pool.d/$2.conf"
49+
pool_file_81="/etc/php/8.1/fpm/pool.d/$2.conf"
50+
51+
if [ -f "$pool_file_56" ]; then
52+
rm $pool_file_56
53+
service php5.6-fpm restart
54+
fi
55+
56+
if [ -f "$pool_file_70" ]; then
57+
rm $pool_file_70
58+
service php7.0-fpm restart
59+
fi
60+
61+
if [ -f "$pool_file_71" ]; then
62+
rm $pool_file_71
63+
service php7.1-fpm restart
64+
fi
65+
66+
if [ -f "$pool_file_72" ]; then
67+
rm $pool_file_72
68+
service php7.2-fpm restart
69+
fi
70+
71+
if [ -f "$pool_file_73" ]; then
72+
rm $pool_file_73
73+
service php7.3-fpm restart
74+
fi
75+
76+
if [ ! -f "$pool_file_74" ]; then
77+
rm $pool_file_74
78+
service php7.4-fpm restart
79+
fi
80+
81+
if [ -f "$pool_file_80" ]; then
82+
rm $pool_file_80
83+
service php8.0-fpm restart
84+
fi
85+
86+
if [ -f "$pool_file_81" ]; then
87+
echo "$pool_conf" > $pool_file_81
88+
service php8.1-fpm restart
89+
fi
90+
91+
exit 0

0 commit comments

Comments
 (0)