diff --git a/lets-encrypt/activate-ssl.sh b/lets-encrypt/activate-ssl.sh
index 9c93e0c4..49d251bf 100644
--- a/lets-encrypt/activate-ssl.sh
+++ b/lets-encrypt/activate-ssl.sh
@@ -143,7 +143,7 @@ then
### SETTINGS ###
- SetHandler "proxy:unix:/run/php/php7.2-fpm.nextcloud.sock|fcgi://localhost"
+ SetHandler "proxy:unix:/run/php/php$PHPVER-fpm.nextcloud.sock|fcgi://localhost"
DocumentRoot $NCPATH
@@ -192,7 +192,7 @@ then
sed -i "s|/dev/null 2>&1
+elif ! dpkg -s php"$PHPVER"-fpm | grep "Status: install ok installed" >/dev/null 2>&1
then
sed -i "s| /dev/null
+if which php"$PHPVER"-fpm > /dev/null
then
- check_command systemctl restart php7.2-fpm.service
+ check_command systemctl restart php"$PHPVER"-fpm.service
fi
}
diff --git a/nextcloud-startup-script.sh b/nextcloud-startup-script.sh
index 0a30a2a2..90235e5b 100644
--- a/nextcloud-startup-script.sh
+++ b/nextcloud-startup-script.sh
@@ -274,7 +274,7 @@ sed -i "s|DocumentRoot /var/www/html|DocumentRoot $HTML|g" /etc/apache2/sites-av
sed -i '14i\ # http://lost.l-w.ca/0x05/apache-mod_proxy_fcgi-and-php-fpm/' /etc/apache2/sites-available/000-default.conf
sed -i '15i\ ' /etc/apache2/sites-available/000-default.conf
sed -i '16i\ ' /etc/apache2/sites-available/000-default.conf
- sed -i '17i\ SetHandler "proxy:unix:/run/php/php7.2-fpm.nextcloud.sock|fcgi://localhost"' /etc/apache2/sites-available/000-default.conf
+ sed -i '17i\ SetHandler "proxy:unix:/run/php/php'$PHPVER'-fpm.nextcloud.sock|fcgi://localhost"' /etc/apache2/sites-available/000-default.conf
sed -i '18i\ ' /etc/apache2/sites-available/000-default.conf
sed -i '19i\ ' /etc/apache2/sites-available/000-default.conf
sed -i '20i\ ' /etc/apache2/sites-available/000-default.conf
diff --git a/nextcloud_install_production.sh b/nextcloud_install_production.sh
index aaf0ae25..fbc1905e 100644
--- a/nextcloud_install_production.sh
+++ b/nextcloud_install_production.sh
@@ -87,7 +87,7 @@ is_this_installed postgresql
is_this_installed apache2
is_this_installed php
is_this_installed php-fpm
-is_this_installed php7.2-fpm
+is_this_installed php"$PHPVER"-fpm
is_this_installed php7.1-fpm
is_this_installed php7.0-fpm
is_this_installed mysql-common
@@ -223,30 +223,30 @@ a2enmod rewrite \
# We don't use Apache PHP (just to be sure)
a2dismod mpm_prefork
-# Install PHP 7.2
+# Install PHP "$PHPVER"
apt update -q4 & spinner_loading
check_command apt install -y \
- php7.2-fpm \
- php7.2-intl \
- php7.2-ldap \
- php7.2-imap \
- php7.2-gd \
- php7.2-pgsql \
- php7.2-curl \
- php7.2-xml \
- php7.2-zip \
- php7.2-mbstring \
- php7.2-soap \
- php7.2-smbclient \
- php7.2-json \
- php7.2-gmp \
- php7.2-bz2 \
+ php"$PHPVER"-fpm \
+ php"$PHPVER"-intl \
+ php"$PHPVER"-ldap \
+ php"$PHPVER"-imap \
+ php"$PHPVER"-gd \
+ php"$PHPVER"-pgsql \
+ php"$PHPVER"-curl \
+ php"$PHPVER"-xml \
+ php"$PHPVER"-zip \
+ php"$PHPVER"-mbstring \
+ php"$PHPVER"-soap \
+ php"$PHPVER"-smbclient \
+ php"$PHPVER"-json \
+ php"$PHPVER"-gmp \
+ php"$PHPVER"-bz2 \
php-pear
- # php7.2-imagick \
+ # php"$PHPVER"-imagick \
# libmagickcore-6.q16-3-extra
# Enable php-fpm
-a2enconf php7.2-fpm
+a2enconf php"$PHPVER"-fpm
# Enable HTTP/2 server wide
print_text_in_color "$ICyan" "Enabling HTTP/2 server wide..."
@@ -265,7 +265,7 @@ cat << POOL_CONF > "$PHP_POOL_DIR/nextcloud.conf"
[Nextcloud]
user = www-data
group = www-data
-listen = /run/php/php7.2-fpm.nextcloud.sock
+listen = /run/php/php"$PHPVER"-fpm.nextcloud.sock
listen.owner = www-data
listen.group = www-data
pm = dynamic
@@ -296,8 +296,8 @@ restart_webserver
calculate_php_fpm
# Enable SMB client # already loaded with php-smbclient
-# echo '# This enables php-smbclient' >> /etc/php/7.2/apache2/php.ini
-# echo 'extension="smbclient.so"' >> /etc/php/7.2/apache2/php.ini
+# echo '# This enables php-smbclient' >> /etc/php/"$PHPVER"/apache2/php.ini
+# echo 'extension="smbclient.so"' >> /etc/php/"$PHPVER"/apache2/php.ini
# Install VM-tools
install_if_not open-vm-tools
@@ -415,7 +415,7 @@ then
### SETTINGS ###
- SetHandler "proxy:unix:/run/php/php7.2-fpm.nextcloud.sock|fcgi://localhost"
+ SetHandler "proxy:unix:/run/php/php$PHPVER-fpm.nextcloud.sock|fcgi://localhost"
DocumentRoot $NCPATH
@@ -475,7 +475,7 @@ then
### SETTINGS ###
- SetHandler "proxy:unix:/run/php/php7.2-fpm.nextcloud.sock|fcgi://localhost"
+ SetHandler "proxy:unix:/run/php/php$PHPVER-fpm.nextcloud.sock|fcgi://localhost"
DocumentRoot $NCPATH
diff --git a/nextcloud_update.sh b/nextcloud_update.sh
index 326e4b18..3237d53f 100644
--- a/nextcloud_update.sh
+++ b/nextcloud_update.sh
@@ -81,9 +81,9 @@ fi
print_text_in_color "$ICyan" "Trying to upgrade the Redis PECL extension..."
if ! pecl list | grep redis >/dev/null 2>&1
then
- if dpkg -l | grep php7.2 > /dev/null 2>&1
+ if dpkg -l | grep php"$PHPVER" > /dev/null 2>&1
then
- install_if_not php7.2-dev
+ install_if_not php"$PHPVER"-dev
elif dpkg -l | grep php7.3 > /dev/null 2>&1
then
install_if_not php7.3-dev
@@ -101,11 +101,11 @@ then
if [ -f /etc/php/7.0/apache2/php.ini ]
then
! [[ "$(grep -R extension=redis.so /etc/php/7.0/apache2/php.ini)" == "extension=redis.so" ]] > /dev/null 2>&1 && echo "extension=redis.so" >> /etc/php/7.0/apache2/php.ini
- # PHP 7.2 apache
- elif [ -f /etc/php/7.2/apache2/php.ini ]
+ # PHP "$PHPVER" apache
+ elif [ -f /etc/php/"$PHPVER"/apache2/php.ini ]
then
- ! [[ "$(grep -R extension=redis.so /etc/php/7.2/apache2/php.ini)" == "extension=redis.so" ]] > /dev/null 2>&1 && echo "extension=redis.so" >> /etc/php/7.2/apache2/php.ini
- # PHP 7.2 fpm
+ ! [[ "$(grep -R extension=redis.so /etc/php/"$PHPVER"/apache2/php.ini)" == "extension=redis.so" ]] > /dev/null 2>&1 && echo "extension=redis.so" >> /etc/php/"$PHPVER"/apache2/php.ini
+ # PHP "$PHPVER" fpm
elif [ -f "$PHP_INI" ]
then
! [[ "$(grep -R extension=redis.so "$PHP_INI")" == "extension=redis.so" ]] > /dev/null 2>&1 && echo "extension=redis.so" >> "$PHP_INI"
@@ -113,9 +113,9 @@ then
restart_webserver
elif pecl list | grep redis >/dev/null 2>&1
then
- if dpkg -l | grep php7.2 > /dev/null 2>&1
+ if dpkg -l | grep php"$PHPVER" > /dev/null 2>&1
then
- install_if_not php7.2-dev
+ install_if_not php"$PHPVER"-dev
elif dpkg -l | grep php7.3 > /dev/null 2>&1
then
install_if_not php7.3-dev
@@ -131,11 +131,11 @@ then
if [ -f /etc/php/7.0/apache2/php.ini ]
then
! [[ "$(grep -R extension=redis.so /etc/php/7.0/apache2/php.ini)" == "extension=redis.so" ]] > /dev/null 2>&1 && echo "extension=redis.so" >> /etc/php/7.0/apache2/php.ini
- # PHP 7.2 apache
- elif [ -f /etc/php/7.2/apache2/php.ini ]
+ # PHP "$PHPVER" apache
+ elif [ -f /etc/php/"$PHPVER"/apache2/php.ini ]
then
- ! [[ "$(grep -R extension=redis.so /etc/php/7.2/apache2/php.ini)" == "extension=redis.so" ]] > /dev/null 2>&1 && echo "extension=redis.so" >> /etc/php/7.2/apache2/php.ini
- # PHP 7.2 fpm
+ ! [[ "$(grep -R extension=redis.so /etc/php/"$PHPVER"/apache2/php.ini)" == "extension=redis.so" ]] > /dev/null 2>&1 && echo "extension=redis.so" >> /etc/php/"$PHPVER"/apache2/php.ini
+ # PHP "$PHPVER" fpm
elif [ -f "$PHP_INI" ]
then
! [[ "$(grep -R extension=redis.so "$PHP_INI")" == "extension=redis.so" ]] > /dev/null 2>&1 && echo "extension=redis.so" >> "$PHP_INI"
diff --git a/static/redis-server-ubuntu.sh b/static/redis-server-ubuntu.sh
index 12f2bb9e..0b8dee47 100644
--- a/static/redis-server-ubuntu.sh
+++ b/static/redis-server-ubuntu.sh
@@ -25,7 +25,7 @@ then
fi
# Install Redis
-install_if_not php7.2-dev
+install_if_not php"$PHPVER"-dev
pecl channel-update pecl.php.net
if ! yes no | pecl install -Z redis
then