# Installation de PHP

Toujours en ligne de commande veuillez installer la version de PHP et les extensions nécessaires.

**Facultatif** : Vous pouvez ajouter le repository pour obtenir des versions alternatives de PHP pour **Ubuntu version 24**

```bash
sudo add-apt-repository ppa:ondrej/php

sudo apt update && sudo apt upgrade -Y
```

<span style="text-decoration: underline;">PHP 8.4 :</span>

```bash
sudo apt install php8.4 php8.4-bcmath php8.4-bz2 php8.4-cli php8.4-common php8.4-gd php8.4-igbinary php8.4-imagick  php8.4-intl php8.4-mbstring php8.4-mysql php8.4-opcache php8.4-readline php8.4-xml php8.4-zip php8.4-curl
```

<span style="text-decoration: underline; background-color: rgb(45, 194, 107);">PHP 8.5 : recommandé</span>

```bash
sudo apt install php8.5 php8.5-bcmath php8.5-bz2 php8.5-cli php8.5-common php8.5-gd php8.5-igbinary php8.5-imagick php8.5-intl php8.5-mbstring php8.5-mysql php8.5-readline php8.5-xml php8.5-zip php8.5-curl
```