diff --git a/ct/bookstack.sh b/ct/bookstack.sh index b1710edd2..97161a27c 100644 --- a/ct/bookstack.sh +++ b/ct/bookstack.sh @@ -39,6 +39,7 @@ function update_script() { msg_ok "Backup finished" fetch_and_deploy_gh_release "bookstack" "BookStackApp/BookStack" + PHP_MODULE="ldap,tidy,bz2,mysqli" PHP_FPM="YES" PHP_APACHE="YES" PHP_VERSION="8.3" setup_php msg_info "Restoring backup" cp /opt/bookstack-backup/.env /opt/bookstack/.env diff --git a/install/bookstack-install.sh b/install/bookstack-install.sh index b279a87e9..917af8bea 100644 --- a/install/bookstack-install.sh +++ b/install/bookstack-install.sh @@ -19,7 +19,8 @@ $STD apt-get install -y \ make msg_ok "Installed Dependencies" -PHP_MODULE="fpm, ldap, tidy, bz2, mysql" PHP_FPM="YES" PHP_APACHE="YES" PHP_VERSION="8.2" setup_php +PHP_MODULE="ldap,tidy,bz2,mysqli" PHP_FPM="YES" PHP_APACHE="YES" PHP_VERSION="8.3" setup_php + setup_composer setup_mariadb diff --git a/misc/tools.func b/misc/tools.func index ba474dbb7..92cffe55e 100644 --- a/misc/tools.func +++ b/misc/tools.func @@ -434,6 +434,13 @@ function setup_php() { $STD apt-get update fi + for pkg in $MODULE_LIST; do + if ! apt-cache show "$pkg" >/dev/null 2>&1; then + msg_error "Package not found: $pkg" + exit 1 + fi + done + local MODULE_LIST="php${PHP_VERSION}" IFS=',' read -ra MODULES <<<"$COMBINED_MODULES" for mod in "${MODULES[@]}"; do @@ -443,6 +450,10 @@ function setup_php() { if [[ "$PHP_FPM" == "YES" ]]; then MODULE_LIST+=" php${PHP_VERSION}-fpm" fi + if [[ "$PHP_APACHE" == "YES" ]]; then + $STD apt-get install -y apache2 + $STD systemctl restart apache2 || true + fi if [[ "$PHP_APACHE" == "YES" ]] && [[ -n "$CURRENT_PHP" ]]; then if [[ -f /etc/apache2/mods-enabled/php${CURRENT_PHP}.load ]]; then @@ -458,10 +469,6 @@ function setup_php() { $STD apt-get install -y $MODULE_LIST msg_ok "Setup PHP $PHP_VERSION" - if [[ "$PHP_APACHE" == "YES" ]]; then - $STD systemctl restart apache2 || true - fi - if [[ "$PHP_FPM" == "YES" ]]; then $STD systemctl enable php${PHP_VERSION}-fpm $STD systemctl restart php${PHP_VERSION}-fpm