From be4e42639335427701d76b01e4c71c45390cd2f3 Mon Sep 17 00:00:00 2001 From: Grant Slater Date: Mon, 18 Aug 2025 18:18:30 +0100 Subject: [PATCH] php: improve version selection logic --- cookbooks/php/attributes/default.rb | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/cookbooks/php/attributes/default.rb b/cookbooks/php/attributes/default.rb index 5dd05a52b..de839f30d 100644 --- a/cookbooks/php/attributes/default.rb +++ b/cookbooks/php/attributes/default.rb @@ -1,8 +1,18 @@ default[:php][:version] = if platform?("debian") - "8.2" - elsif node[:lsb][:release].to_f < 22.04 - "7.4" - else - "8.1" + case node[:platform_version].to_i + when 13 + "8.4" # PHP version for Debian 13 Trixie + when 12 + "8.2" # PHP version for Debian 12 Bookworm + end + elsif platform?("ubuntu") + case node[:lsb][:release].to_f + when 24.04 + "8.3" # PHP version for Ubuntu 24.04 + when 22.04 + "8.1" # PHP version for Ubuntu 22.04 + when 20.04 + "7.4" # PHP version for Ubuntu 20.04 + end end default[:php][:fpm][:options] = {} -- 2.39.5