diff --git a/misc/tools.func b/misc/tools.func index ba309d873..6205446e1 100644 --- a/misc/tools.func +++ b/misc/tools.func @@ -4387,11 +4387,19 @@ EOF return 1 } - manage_tool_repository "php" "$PHP_VERSION" "" "https://packages.sury.org/debsuryorg-archive-keyring.deb" || { - msg_error "Failed to setup PHP repository" - return 1 - } - + # Use different repository based on OS + if [[ "$DISTRO_ID" == "ubuntu" ]]; then + # Ubuntu: Use ondrej/php PPA + msg_info "Adding ondrej/php PPA for Ubuntu" + $STD apt install -y software-properties-common + $STD add-apt-repository -y ppa:ondrej/php + else + # Debian: Use Sury repository + manage_tool_repository "php" "$PHP_VERSION" "" "https://packages.sury.org/debsuryorg-archive-keyring.deb" || { + msg_error "Failed to setup PHP repository" + return 1 + } + fi ensure_apt_working || return 1 $STD apt update