Skip to content

Commit 37c4d25

Browse files
committed
Add check if hestia-php has openssl enabled
If so it uses hestia-php instead of php
1 parent e3b293a commit 37c4d25

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

bin/v-add-sys-filemanager

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ check_hestia_demo_mode
6363
# Action #
6464
#----------------------------------------------------------#
6565

66+
openssl_installed=$(/usr/local/hestia/php/bin/php -m | grep openssl);
67+
6668
rm --recursive --force "$FM_INSTALL_DIR"
6769
mkdir -p "$FM_INSTALL_DIR"
6870
cd "$FM_INSTALL_DIR"
@@ -78,7 +80,11 @@ cp --recursive --force ${HESTIA_INSTALL_DIR}/filemanager/filegator/* "${FM_INSTA
7880

7981
chown $user: -R "${FM_INSTALL_DIR}"
8082

81-
COMPOSER_HOME="$HOMEDIR/$user/.config/composer" user_exec /usr/local/hestia/php/bin/php $COMPOSER_BIN --quiet --no-dev install
83+
if [ -z "$openssl_version" ]; then
84+
COMPOSER_HOME="$HOMEDIR/$user/.config/composer" user_exec /usr/bin/php $COMPOSER_BIN --quiet --no-dev install
85+
else
86+
COMPOSER_HOME="$HOMEDIR/$user/.config/composer" user_exec /usr/local/hestia/php/bin/php $COMPOSER_BIN --quiet --no-dev install
87+
fi
8288

8389
# Check if installation was successful, if not abort script and throw error message notification and clean-up
8490
if [ $? -ne 0 ]; then

bin/v-add-sys-phpmailer

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,12 @@ rm --recursive --force ${PM_INSTALL_DIR}/vendor
6565
mkdir -p ${PM_INSTALL_DIR}/vendor
6666
chown $user: -R ${PM_INSTALL_DIR}/vendor
6767

68-
COMPOSER_HOME="$HOMEDIR/$user/.config/composer" user_exec /usr/local/hestia/php/bin/php $COMPOSER_BIN --quiet --no-dev install
68+
openssl_installed=$(/usr/local/hestia/php/bin/php -m | grep openssl);
69+
if [ -z "$openssl_version" ]; then
70+
COMPOSER_HOME="$HOMEDIR/$user/.config/composer" user_exec /usr/bin/php $COMPOSER_BIN --quiet --no-dev install
71+
else
72+
COMPOSER_HOME="$HOMEDIR/$user/.config/composer" user_exec /usr/local/hestia/php/bin/php $COMPOSER_BIN --quiet --no-dev install
73+
fi
6974

7075
# Check if installation was successful, if not abort script and throw error message notification and clean-up
7176
if [ $? -ne 0 ]; then

0 commit comments

Comments
 (0)