mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2025-04-20 14:48:06 +00:00
Update PHP to 8.3 (#3510)
This commit is contained in:
parent
59ebbd37fa
commit
dff0c3b713
20
ct/2fauth.sh
20
ct/2fauth.sh
@ -41,8 +41,23 @@ function update_script() {
|
||||
# Creating Backup
|
||||
msg_info "Creating Backup"
|
||||
mv "/opt/2fauth" "/opt/2fauth-backup"
|
||||
if ! dpkg -l | grep -q 'php8.3'; then
|
||||
cp /etc/nginx/conf.d/2fauth.conf /etc/nginx/conf.d/2fauth.conf.bak
|
||||
fi
|
||||
msg_ok "Backup Created"
|
||||
|
||||
# Upgrade PHP
|
||||
if ! dpkg -l | grep -q 'php8.3'; then
|
||||
$STD apt-get install -y \
|
||||
lsb-release \
|
||||
gpg
|
||||
curl -fsSL https://packages.sury.org/php/apt.gpg | gpg --dearmor -o /usr/share/keyrings/deb.sury.org-php.gpg
|
||||
echo "deb [signed-by=/usr/share/keyrings/deb.sury.org-php.gpg] https://packages.sury.org/php/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/php.list
|
||||
$STD apt-get update
|
||||
$STD apt-get install -y php8.3-{bcmath,common,ctype,curl,fileinfo,fpm,gd,mbstring,mysql,xml,cli,intl}
|
||||
sed -i 's/php8.2/php8.3/g' /etc/nginx/conf.d/2fauth.conf
|
||||
fi
|
||||
|
||||
# Execute Update
|
||||
wget -q "https://github.com/Bubka/2FAuth/archive/refs/tags/${RELEASE}.zip"
|
||||
unzip -q "${RELEASE}.zip"
|
||||
@ -59,9 +74,14 @@ function update_script() {
|
||||
|
||||
php artisan 2fauth:install
|
||||
|
||||
$STD systemctl restart nginx
|
||||
|
||||
# Cleaning up
|
||||
msg_info "Cleaning Up"
|
||||
rm -rf "v${RELEASE}.zip"
|
||||
if dpkg -l | grep -q 'php8.2'; then
|
||||
$STD apt-get remove --purge -y php8.2*
|
||||
fi
|
||||
$STD apt-get -y autoremove
|
||||
$STD apt-get -y autoclean
|
||||
msg_ok "Cleanup Completed"
|
||||
|
@ -14,10 +14,19 @@ network_check
|
||||
update_os
|
||||
|
||||
msg_info "Installing Dependencies"
|
||||
|
||||
$STD apt-get install -y \
|
||||
lsb-release \
|
||||
gpg
|
||||
|
||||
curl -fsSL https://packages.sury.org/php/apt.gpg | gpg --dearmor -o /usr/share/keyrings/deb.sury.org-php.gpg
|
||||
echo "deb [signed-by=/usr/share/keyrings/deb.sury.org-php.gpg] https://packages.sury.org/php/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/php.list
|
||||
$STD apt-get update
|
||||
|
||||
$STD apt-get install -y \
|
||||
nginx \
|
||||
composer \
|
||||
php8.2-{bcmath,common,ctype,curl,fileinfo,fpm,gd,mbstring,mysql,xml,cli} \
|
||||
php8.3-{bcmath,common,ctype,curl,fileinfo,fpm,gd,mbstring,mysql,xml,cli} \
|
||||
mariadb-server
|
||||
msg_ok "Installed Dependencies"
|
||||
|
||||
@ -90,7 +99,7 @@ server {
|
||||
error_page 404 /index.php;
|
||||
|
||||
location ~ \.php\$ {
|
||||
fastcgi_pass unix:/var/run/php/php8.2-fpm.sock;
|
||||
fastcgi_pass unix:/var/run/php/php8.3-fpm.sock;
|
||||
fastcgi_param SCRIPT_FILENAME \$realpath_root\$fastcgi_script_name;
|
||||
include fastcgi_params;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user