This commit is contained in:
CanbiZ 2025-07-22 15:55:56 +02:00
parent ff51b1e5dc
commit 4b3233d6a8

View File

@ -438,14 +438,15 @@ function setup_php() {
# install apache2 with PHP support if requested # install apache2 with PHP support if requested
if [[ "$PHP_APACHE" == "YES" ]]; then if [[ "$PHP_APACHE" == "YES" ]]; then
if ! dpkg -l | grep -q "libapache2-mod-php${PHP_VERSION}"; then if ! dpkg -l | grep -q "libapache2-mod-php${PHP_VERSION}"; then
$STD msg_info "Installing Apache with PHP${PHP_VERSION} support" msg_info "Installing Apache with PHP${PHP_VERSION} support"
$STD apt-get install -y apache2 libapache2-mod-php"${PHP_VERSION}" $STD apt-get install -y apache2 libapache2-mod-php${PHP_VERSION}
$STD msg_ok "Setup Apache with PHP${PHP_VERSION}" else
msg_info "Apache with PHP${PHP_VERSION} already installed skipping install"
fi fi
fi fi
# setup / update PHP modules # setup / update PHP modules
$STD apt-get install -y "$MODULE_LIST" $STD apt-get install -y $MODULE_LIST
msg_ok "Setup PHP $PHP_VERSION" msg_ok "Setup PHP $PHP_VERSION"
# optional stop old PHP-FPM service # optional stop old PHP-FPM service
@ -484,14 +485,13 @@ function setup_php() {
# enable and restart PHP-FPM if requested # enable and restart PHP-FPM if requested
if [[ "$PHP_FPM" == "YES" ]]; then if [[ "$PHP_FPM" == "YES" ]]; then
if systemctl list-unit-files | grep -q "php${PHP_VERSION}-fpm.service"; then if systemctl list-unit-files | grep -q "php${PHP_VERSION}-fpm.service"; then
$STD systemctl enable php"${PHP_VERSION}"-fpm $STD systemctl enable php${PHP_VERSION}-fpm
$STD systemctl restart php"${PHP_VERSION}"-fpm $STD systemctl restart php${PHP_VERSION}-fpm
else else
msg_warn "FPM requested but service php${PHP_VERSION}-fpm not found" msg_warn "FPM requested but service php${PHP_VERSION}-fpm not found"
fi fi
fi fi
} }
# ------------------------------------------------------------------------------ # ------------------------------------------------------------------------------
# Installs or updates Composer globally. # Installs or updates Composer globally.
# #