fix: détection automatique version PHP (support Debian 13 Trixie/PHP 8.4)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Jules
2026-05-05 11:24:06 +02:00
parent 0be1b9119a
commit d36780a725

View File

@@ -32,9 +32,13 @@ apt-get upgrade -y -qq
# =============================================================================
step "Installation des paquets"
PHP_VER=$(apt-cache search '^php[0-9]\.[0-9]-fpm$' | awk '{print $1}' | sort -V | tail -1 | grep -oP '\d+\.\d+')
[[ -z "$PHP_VER" ]] && PHP_VER="8.4"
log "Version PHP détectée : ${PHP_VER}"
DEBIAN_FRONTEND=noninteractive apt-get install -y -qq \
nginx \
php8.2-fpm php8.2-mysql php8.2-cli php8.2-mbstring php8.2-curl php8.2-intl \
php${PHP_VER}-fpm php${PHP_VER}-mysql php${PHP_VER}-cli php${PHP_VER}-mbstring php${PHP_VER}-curl php${PHP_VER}-intl \
mariadb-server \
postfix postfix-mysql \
dovecot-core dovecot-imapd \
@@ -229,7 +233,7 @@ server {
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php8.2-fpm.sock;
fastcgi_pass unix:/run/php/php${PHP_VER}-fpm.sock;
fastcgi_param SCRIPT_FILENAME \$document_root\$fastcgi_script_name;
}