Skip to content

Commit 7faf9ef

Browse files
committed
Fix missing mysql packages when installing multiphp stack
- DB_SYSTEM hestia config wasn't set
1 parent 6a2f359 commit 7faf9ef

File tree

3 files changed

+42
-5
lines changed

3 files changed

+42
-5
lines changed

bin/v-add-web-php

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,19 +55,20 @@ check_hestia_demo_mode
5555
mph="php$version-mbstring php$version-bcmath php$version-cli php$version-curl
5656
php$version-fpm php$version-gd php$version-intl php$version-mysql
5757
php$version-soap php$version-xml php$version-zip php$version-mbstring
58-
php$version-json php$version-bz2 php$version-pspell php$version-imagick php$version-pgsql"
58+
php$version-json php$version-bz2 php$version-pspell php$version-imagick php$version-pgsql
59+
php$version-imap php$version-ldap"
5960

6061
# Check is version is 7.1 or below to add mcrypt
6162
if [[ `echo "$version 7.2" | awk '{print ($1 < $2)}'` == 1 ]]; then
6263
mph="$mph php$version-mcrypt"
6364
fi
6465

65-
if [ -z "$DB_SYSTEM" -o "$DB_SYSTEM" = "mysql" ]; then
66-
mph=$(echo "$mph" | sed -e "s/php$version-pgsql//")
66+
if ! echo "$DB_SYSTEM" | grep -w 'mysql' >/dev/null; then
67+
mph=$(echo "$mph" | sed -e "s/php$version-mysql//")
6768
fi
6869

69-
if [ -z "$DB_SYSTEM" -o "$DB_SYSTEM" = "pgsql" ]; then
70-
mph=$(echo "$mph" | sed -e "s/php$version-mysql//")
70+
if ! echo "$DB_SYSTEM" | grep -w 'pgsql' >/dev/null; then
71+
mph=$(echo "$mph" | sed -e "s/php$version-pgsql//")
7172
fi
7273

7374
# Install php packages

install/hst-install-debian.sh

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1012,6 +1012,24 @@ else
10121012
fi
10131013
fi
10141014

1015+
# Database stack
1016+
if [ "$mysql" = 'yes' ]; then
1017+
installed_db_types='mysql'
1018+
fi
1019+
1020+
if [ "$pgsql" = 'yes' ]; then
1021+
installed_db_types="$installed_db_type,pgsql"
1022+
fi
1023+
1024+
if [ ! -z "$installed_db_types" ]; then
1025+
db=$(echo "$installed_db_types" |\
1026+
sed "s/,/\n/g"|\
1027+
sort -r -u |\
1028+
sed "/^$/d"|\
1029+
sed ':a;N;$!ba;s/\n/,/g')
1030+
echo "DB_SYSTEM='$db'" >> $HESTIA/conf/hestia.conf
1031+
fi
1032+
10151033
# FTP stack
10161034
if [ "$vsftpd" = 'yes' ]; then
10171035
echo "FTP_SYSTEM='vsftpd'" >> $HESTIA/conf/hestia.conf

install/hst-install-ubuntu.sh

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -982,6 +982,24 @@ if [ "$phpfpm" = 'yes' ] || [ "$multiphp" = 'yes' ]; then
982982
echo "WEB_BACKEND='php-fpm'" >> $HESTIA/conf/hestia.conf
983983
fi
984984

985+
# Database stack
986+
if [ "$mysql" = 'yes' ]; then
987+
installed_db_types='mysql'
988+
fi
989+
990+
if [ "$pgsql" = 'yes' ]; then
991+
installed_db_types="$installed_db_type,pgsql"
992+
fi
993+
994+
if [ ! -z "$installed_db_types" ]; then
995+
db=$(echo "$installed_db_types" |\
996+
sed "s/,/\n/g"|\
997+
sort -r -u |\
998+
sed "/^$/d"|\
999+
sed ':a;N;$!ba;s/\n/,/g')
1000+
echo "DB_SYSTEM='$db'" >> $HESTIA/conf/hestia.conf
1001+
fi
1002+
9851003
# FTP stack
9861004
if [ "$vsftpd" = 'yes' ]; then
9871005
echo "FTP_SYSTEM='vsftpd'" >> $HESTIA/conf/hestia.conf

0 commit comments

Comments
 (0)