In this tutorial, I will show you how to install PHP 8 on your Debian server.
Getting Started
Make sure your server is having the latest packages by running the command.
apt update && apt upgrade -yI will use the SURY PHP PPA repository which contains all the released versions of PHP to date.
Install the below packages.
apt -y install lsb-release apt-transport-https ca-certificates wgetDownload and import gpg key.
wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpgOnce you have downloaded the PPA you can add it to the server packages.
echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" | sudo tee /etc/apt/sources.list.d/php.listNow you can proceed the installation of PHP 8 by updating the system.
apt updateInstall PHP 8
apt install php8.0Verify installation
php -vI have apache installed on my server, so I can verify PHP 8 installation in PHP sample file.
echo "<?php phpinfo();" > /var/www/html/info.phpNow open in browser http:/your-IP/info.php
That’s all, you have successfully installed PHP 8 on your Debian server.



