Skip to content

Commit e631286

Browse files
authored
Bookstack: Fix PHP Issue & Bump to PHP 8.3 (#5779)
1 parent e58ad92 commit e631286

File tree

3 files changed

+14
-5
lines changed

3 files changed

+14
-5
lines changed

ct/bookstack.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ function update_script() {
3939
msg_ok "Backup finished"
4040

4141
fetch_and_deploy_gh_release "bookstack" "BookStackApp/BookStack"
42+
PHP_MODULE="ldap,tidy,bz2,mysqli" PHP_FPM="YES" PHP_APACHE="YES" PHP_VERSION="8.3" setup_php
4243

4344
msg_info "Restoring backup"
4445
cp /opt/bookstack-backup/.env /opt/bookstack/.env

install/bookstack-install.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ $STD apt-get install -y \
1919
make
2020
msg_ok "Installed Dependencies"
2121

22-
PHP_MODULE="fpm, ldap, tidy, bz2, mysql" PHP_FPM="YES" PHP_APACHE="YES" PHP_VERSION="8.2" setup_php
22+
PHP_MODULE="ldap,tidy,bz2,mysqli" PHP_FPM="YES" PHP_APACHE="YES" PHP_VERSION="8.3" setup_php
23+
2324
setup_composer
2425
setup_mariadb
2526

misc/tools.func

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -434,6 +434,13 @@ function setup_php() {
434434
$STD apt-get update
435435
fi
436436

437+
for pkg in $MODULE_LIST; do
438+
if ! apt-cache show "$pkg" >/dev/null 2>&1; then
439+
msg_error "Package not found: $pkg"
440+
exit 1
441+
fi
442+
done
443+
437444
local MODULE_LIST="php${PHP_VERSION}"
438445
IFS=',' read -ra MODULES <<<"$COMBINED_MODULES"
439446
for mod in "${MODULES[@]}"; do
@@ -443,6 +450,10 @@ function setup_php() {
443450
if [[ "$PHP_FPM" == "YES" ]]; then
444451
MODULE_LIST+=" php${PHP_VERSION}-fpm"
445452
fi
453+
if [[ "$PHP_APACHE" == "YES" ]]; then
454+
$STD apt-get install -y apache2
455+
$STD systemctl restart apache2 || true
456+
fi
446457

447458
if [[ "$PHP_APACHE" == "YES" ]] && [[ -n "$CURRENT_PHP" ]]; then
448459
if [[ -f /etc/apache2/mods-enabled/php${CURRENT_PHP}.load ]]; then
@@ -458,10 +469,6 @@ function setup_php() {
458469
$STD apt-get install -y $MODULE_LIST
459470
msg_ok "Setup PHP $PHP_VERSION"
460471

461-
if [[ "$PHP_APACHE" == "YES" ]]; then
462-
$STD systemctl restart apache2 || true
463-
fi
464-
465472
if [[ "$PHP_FPM" == "YES" ]]; then
466473
$STD systemctl enable php${PHP_VERSION}-fpm
467474
$STD systemctl restart php${PHP_VERSION}-fpm

0 commit comments

Comments
 (0)