Skip to content

Commit e4b2e05

Browse files
committed
fixes bug in setup_php
1 parent e05a351 commit e4b2e05

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

install/phpipam-install.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ msg_info "Installing Dependencies"
1717
$STD apt install -y fping
1818
msg_ok "Installed Dependencies"
1919

20-
PHP_VERSION="8.3" PHP_APACHE="YES" PHP_FPM="YES" PHP_MODULE="mysql,gmp,snmp,ldap,apcu" setup_php
20+
PHP_VERSION="8.3" PHP_APACHE="YES" PHP_FPM="YES" PHP_MODULE="pdo,pdo-mysql,gmp,snmp,ldap,apcu" setup_php
2121

2222
msg_info "Installing PHP-PEAR"
2323
$STD apt install -y \

misc/tools.func

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3698,7 +3698,10 @@ EOF
36983698
fi
36993699

37003700
# Install PHP packages (pinning via preferences.d ensures correct version)
3701+
msg_info "Installing PHP ${PHP_VERSION} packages"
37013702
if ! install_packages_with_retry $MODULE_LIST; then
3703+
msg_warn "Failed to install PHP packages, attempting individual installation"
3704+
37023705
# Install main package first (critical)
37033706
install_packages_with_retry "php${PHP_VERSION}" || {
37043707
msg_error "Failed to install php${PHP_VERSION}"
@@ -3707,19 +3710,25 @@ EOF
37073710

37083711
# Try to install Apache module individually if requested
37093712
if [[ "$PHP_APACHE" == "YES" ]]; then
3710-
install_packages_with_retry "libapache2-mod-php${PHP_VERSION}" || true
3713+
install_packages_with_retry "libapache2-mod-php${PHP_VERSION}" || {
3714+
msg_warn "Could not install libapache2-mod-php${PHP_VERSION}"
3715+
}
37113716
fi
37123717

37133718
# Try to install modules individually - skip those that don't exist
37143719
for pkg in "${MODULES[@]}"; do
37153720
if apt-cache search "^php${PHP_VERSION}-${pkg}\$" 2>/dev/null | grep -q "^php${PHP_VERSION}-${pkg}"; then
3716-
install_packages_with_retry "php${PHP_VERSION}-${pkg}" || true
3721+
install_packages_with_retry "php${PHP_VERSION}-${pkg}" || {
3722+
msg_warn "Could not install php${PHP_VERSION}-${pkg}"
3723+
}
37173724
fi
37183725
done
37193726

37203727
if [[ "$PHP_FPM" == "YES" ]]; then
37213728
if apt-cache search "^php${PHP_VERSION}-fpm\$" 2>/dev/null | grep -q "^php${PHP_VERSION}-fpm"; then
3722-
install_packages_with_retry "php${PHP_VERSION}-fpm" || true
3729+
install_packages_with_retry "php${PHP_VERSION}-fpm" || {
3730+
msg_warn "Could not install php${PHP_VERSION}-fpm"
3731+
}
37233732
fi
37243733
fi
37253734
fi

0 commit comments

Comments
 (0)