Add snippet 'get-path-of-php-command.sh' and change concerning code..

This commit is contained in:
2023-08-03 00:11:02 +02:00
parent 1df7bb124b
commit d84294cf0b
18 changed files with 287 additions and 117 deletions

View File

@ -301,25 +301,9 @@ source ${snippet_dir}/get-webservice-environment.sh
source ${snippet_dir}/get-php-major-version.sh
# - Determin PHP binary
# -
if [[ -x "/usr/local/php-${PHP_VERSION}/bin/php" ]] ; then
php_binary="/usr/local/php-${PHP_VERSION}/bin/php"
else
php_binary="$(realpath "$(which php)")"
if [[ -z "$php_binary" ]]; then
if [[ -x "/usr/local/php/bin/php" ]]; then
php_binary="/usr/local/php/bin/php"
else
fatal "No PHP binary present"
fi
else
if [[ ! -x "$php_binary" ]]; then
fatal "Found PHP binary '$php_binary', but this file is not executable!"
fi
fi
fi
# Get full qualified PHP command
#
source ${snippet_dir}/get-path-of-php-command.sh
@ -371,7 +355,7 @@ read _IN
done
CURRENT_INSTALL_DIR=`realpath ${WEB_BASE_DIR}/nextcloud`
CURRENT_VERSION="$(sudo -u $HTTP_USER $php_binary ${WEB_BASE_DIR}/htdocs/occ --version | cut -d' ' -f2)"
CURRENT_VERSION="$(sudo -u $HTTP_USER ${PHP_BIN} ${WEB_BASE_DIR}/htdocs/occ --version | cut -d' ' -f2)"
DATA_DIR=${WEB_BASE_DIR}/data
@ -389,7 +373,8 @@ echo -e " Webserver user.......................: $HTTP_USER"
echo ""
echo -e " PHP version..........................: $PHP_VERSION"
echo -e " PHP Engine...........................: $PHP_ENGINE"
echo -e " PHP binary...........................: $php_binary"
echo ""
echo -e " PHP Command..........................: $PHP_BIN"
echo ""
echo -e " Version to rstore....................: $RESTORE_VERSION"
echo -e " Backup date was......................: $DATE_RESTORE_VERSION"