Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/nextcloudpi.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorthecalcaholic <6317548+theCalcaholic@users.noreply.github.com>2022-09-28 11:55:15 +0300
committerthecalcaholic <6317548+theCalcaholic@users.noreply.github.com>2022-09-28 11:55:15 +0300
commitd784a6a932977fc2b2a04eceeaa1803c8e159dea (patch)
tree23a7cf822c3403fb3354cd5daa3f1aa05175218c
parent6a2867e638758d17531c1bcc126ab64821547977 (diff)
v1.50.1.sh: Fix missing PHP 8 configuration on docker
Signed-off-by: thecalcaholic <6317548+theCalcaholic@users.noreply.github.com>
-rw-r--r--updates/1.50.1.sh42
1 files changed, 40 insertions, 2 deletions
diff --git a/updates/1.50.1.sh b/updates/1.50.1.sh
index a440ff07..39726f2e 100644
--- a/updates/1.50.1.sh
+++ b/updates/1.50.1.sh
@@ -6,6 +6,44 @@ source /usr/local/etc/library.sh
install_template systemd/notify_push.service.sh /etc/systemd/system/notify_push.service
+if is_docker
+then
-clear_opcache
-bash -c "sleep 6; service php${PHPVER}-fpm restart" &>/dev/null &
+ echo "Upgrading PHP..."
+ export DEBIAN_FRONTEND=noninteractive
+ PHPVER_OLD="7.4"
+ PHPVER_NEW="8.1"
+
+ php_restore() {
+ trap "" INT TERM HUP ERR
+ echo "Something went wrong while upgrading PHP. Rolling back..."
+ set +e
+ a2disconf php${PHPVER_NEW}-fpm
+ set_ncpcfg "php_version" "${PHPVER_OLD}"
+ install_template "php/opcache.ini.sh" "/etc/php/${PHPVER_OLD}/mods-available/opcache.ini"
+ clear_opcache
+ run_app nc-limits
+ a2enconf "php${PHPVER_OLD}-fpm"
+ service "php${PHPVER_OLD}-fpm" start
+ service apache2 restart
+ echo "PHP upgrade has been reverted. Please downgrade to the previous docker image"
+ }
+
+ trap php_restore INT TERM HUP ERR
+
+ # Setup apt repository for php 8
+
+ a2disconf "php${PHPVER_OLD}-fpm"
+ set_ncpcfg "php_version" "${PHPVER_NEW}"
+ install_template "php/opcache.ini.sh" "/etc/php/${PHPVER_NEW}/mods-available/opcache.ini"
+ ( set -e; export PHPVER="${PHPVER_NEW}"; run_app nc-limits )
+ clear_opcache
+ a2enconf "php${PHPVER_NEW}-fpm"
+ service "php${PHPVER_NEW}-fpm" start
+ service apache2 restart
+
+else
+
+ clear_opcache
+ bash -c "sleep 6; service php${PHPVER}-fpm restart" &>/dev/null &
+fi