×



Originally developed by Rasmus Lerdorf, a Danish-Canadian developer, PHP is a server-side scripting language that is geared towards the development of both dynamic and static webpages. PHP is a recursive acronym for PHP Hypertext Preprocessor but was initially an acronym for Personal Home Page. Currently, two PHP releases are receiving active support – PHP 7.4 and PHP 8.0.

The most current and stable release is PHP 8.0. It was released on Nov 16, 2020, and enjoys support until 2023provides improvements and enhancements such as named arguments, null safe operator, union types, JIT (Just In Type) compiler, and improvements in consistency and error-handling.

Here at LinuxAPT, as part of our Server Management Services, we regularly help our Customers to perform related PHP Installation and configuration queries on any Linux Distribution.

In this context, we shall look into the installation procedure of PHP 8.0 on Debian / Linux Mint.


Steps to Install PHP 8.0 on Linux Mint / Debian / Ubuntu

1. Update the system

To begin, we are going to update the package list of the system. This can be done by executing the command:

$ sudo apt update

Once updated, install the dependencies required:

$ sudo apt install software-properties-common ca-certificates lsb_release apt-transport-https


2. Enable the Sury APT repository

Here, add the SURY repository to our system. SURY is a third-party PHP repository that packages PHP packages for Debian. To add the repository, run the command:

$ sudo sh -c 'echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/php.list'

Next, import the repository's GPG key:

$ wget -qO - https://packages.sury.org/php/apt.gpg | sudo apt-key add -


3. Install PHP 8.0

To install PHP 8.0, update the package lists to sync with the newly added SURY repository

$ sudo apt update

Then install PHP 8.0 on Debian Buster as follows.

$ sudo apt install php8.0

Once installed, verify the PHP release installed:

$ php -v

Also, you can install PHP extensions using the syntax:

$ sudo apt install php-extension

If you are installing multiple extensions, specify them inside the curly braces as shown below. Here, we are installing the php-cli, php-mbstring, php-xml, php-common, php-ldap the php-curl extensions:

$ sudo apt install php8.0-{cli,mbstring,xml,common,ldap,curl}


[Need help in Configuring PHP on Ubuntu Linux ? We can help you. ]


Conclusion


More Linux Tutorials

We create Linux HowTos and Tutorials for Sys Admins. Visit us on IbmiMedia.com

Also for Tech related tips, Visit forum.outsourcepath.com or General Technical tips on www.outsourcepath.com