From cad29cdc717fe631fda5c2fcb1ad365b0010bf33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9drix?= <cedric@abonnel.fr> Date: Sun, 23 Mar 2025 21:49:17 +0100 Subject: [PATCH] =?UTF-8?q?demande=20si=20on=20cr=C3=A9=C3=A9=20la=20page?= =?UTF-8?q?=20info.php?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/server-httpd/install-php8-3.sh | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/scripts/server-httpd/install-php8-3.sh b/scripts/server-httpd/install-php8-3.sh index 9eac376..e2684d0 100644 --- a/scripts/server-httpd/install-php8-3.sh +++ b/scripts/server-httpd/install-php8-3.sh @@ -113,11 +113,18 @@ fi # Test de la configuration Apache if systemctl is-active --quiet apache2; then - echo -e "${YELLOW}Vérification du support de PHP par Apache...${RESET}" - echo "<?php phpinfo(); ?>" > /var/www/html/info.php - chown www-data:www-data /var/www/html/info.php - chmod 644 /var/www/html/info.php - echo -e "${GREEN}Vous pouvez tester PHP en accédant à : http://<IP_SERVEUR>/info.php${RESET}" + read -rp "Voulez-vous tester le support de PHP par Apache ? (o/n) : " test_php + if [[ "$test_php" =~ ^[oOyY]$ ]]; then + echo -e "${YELLOW}Vérification du support de PHP par Apache...${RESET}" + echo "<?php phpinfo(); ?>" > /var/www/html/info.php + chown www-data:www-data /var/www/html/info.php + chmod 644 /var/www/html/info.php + echo -e "${GREEN}Vous pouvez tester PHP en accédant à : http://<IP_SERVEUR>/info.php${RESET}" + else + echo -e "${YELLOW}Test PHP annulé.${RESET}" + fi +else + echo -e "${RED}Le service Apache n'est pas actif.${RESET}" fi echo -e "${GREEN}Installation terminée avec succès ! 🚀${RESET}"