How To Install PHP 8.4 On Debian 13 Trixie

How To Install PHP 8.4 On Debian 13 Trixie

PHP 8.4 is the latest release offering performance improvements and new language features. This guide will show you how to install PHP 8.4 on Debian 13 (Trixie) step by step, including enabling the correct repository and installing essential PHP modules.

Step 1 : Update Your System

sudo apt update && sudo apt upgrade -y

Step 2 : Install Required Dependencies

sudo apt install ca-certificates apt-transport-https software-properties-common -y

Step 3 : Add The SURY PHP Repository

SURY is a popular repository providing updated PHP versions for Debian.

wget -O /etc/apt/trusted.gpg.d/sury.gpg https://packages.sury.org/php/apt.gpg
echo "deb https://packages.sury.org/php/ trixie main" | sudo tee /etc/apt/sources.list.d/sury-php.list

Step 4 : Update Repository Index

sudo apt update

Step 5 : Install PHP 8.4

sudo apt install php8.4

Step 6 : Install Common PHP 8.4 Extensions

sudo apt install php8.4-cli php8.4-fpm php8.4-mysql php8.4-xml php8.4-curl php8.4-mbstring php8.4-zip php8.4-gd

Step 7 : Confirm Installation

php -v

Step 8 : Restart Services (if using a web server)

For Nginx :

sudo systemctl restart nginx

For Apache :

sudo systemctl restart apache2

You're Done!

PHP 8.4 is now successfully installed on your Debian 13 system. You can begin deploying applications and configuring your environment.

ahmad

Ahmad

I am just began write something this similar tips website, and hope you like it what I just began.