From f78a24862ecb73675e110fcc2fd61c1f70106d4d Mon Sep 17 00:00:00 2001 From: Ollama Date: Wed, 13 May 2026 21:32:22 +0200 Subject: [PATCH] fix: add ondrej/php PPA when PHP version not in default repos The install script was failing on Ubuntu 22.04 because PHP 8.2 is not available in default repositories. This fix checks if the requested PHP version is available, and if not, adds the ondrej/php PPA which provides all supported PHP versions. --- scripts/install-ubuntu.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/scripts/install-ubuntu.sh b/scripts/install-ubuntu.sh index ab2f14ff8..26d16d481 100644 --- a/scripts/install-ubuntu.sh +++ b/scripts/install-ubuntu.sh @@ -65,6 +65,14 @@ echo -e "${COLOR_GREEN}[1/9] Updating system packages...${COLOR_RESET}" apt-get update -qq echo -e "${COLOR_GREEN}[2/9] Installing Apache, PHP, and dependencies...${COLOR_RESET}" +# Add PHP repository for newer PHP versions if not available in default repos +if ! apt-cache policy php${PHP_VERSION} 2>/dev/null | grep -q "Candidate:"; then + echo -e "${COLOR_YELLOW}PHP ${PHP_VERSION} not in default repos, adding ondrej/php PPA...${COLOR_RESET}" + apt-get install -y -qq software-properties-common + add-apt-repository -y ppa:ondrej/php + apt-get update -qq +fi + apt-get install -y -qq \ apache2 \ mariadb-server \