How to Install PHP 8.1 on Ubuntu 22.04?
This tutorial shows you how to install php 8.1 on ubuntu 22.04. we will help you to give an example of install php 8.1 on ubuntu 22.04. you will learn how to install php 8.1 in ubuntu 22.04. In this article, we will implement a ubuntu 22.04 install php 8.1.
As of October 2021, there is no official release of Ubuntu 22.04. The latest stable version is Ubuntu 21.10 (Impish Indri). However, you can still install PHP 8.1 on Ubuntu 21.10 by following these steps. I will give you just simple few step to install php 8.1 in ubuntu 22.04.
Let's see the simple steps:
Step 1: Run System Updates
To ensure that our repositories are up to date, the first step in a new system is to update them. Additionally, it is essential to run the upgrade command.
sudo apt update
Step 2: Add Ondrej Sury PPA Repository
To run PHP 8.1 on Ubuntu 22.04, it is necessary to include Ondrej Sury's PPA in our system. Ondrej Sury is currently responsible for maintaining the PHP repository. However, please note that this PPA is not currently verified, so there is no guarantee of obtaining 100% reliable results when installing from it.
To add this PPA, execute the following command in our terminal.
sudo apt install software-properties-common
sudo add-apt-repository ppa:ondrej/php
sudo apt update
Step 3: Install PHP 8.1 and Common Extensions
We should now be able to install PHP 8.1 on Ubuntu 22.04 Linux machine. The commands to run are as shared below:
sudo apt install php8.1
sudo apt install php8.1-cli php8.1-common php8.1-json php8.1-opcache php8.1-mysql php8.1-mbstring php8.1-zip php8.1-fpm php8.1-xml php8.1-bcmath php8.1-gd php8.1-curl php8.1-intl php8.1-redis php8.1-imagick
Now, you can check your php version using following command:
I hope it can help you...
We are Recommending you
- How to Check MySQL Version in Ubuntu?
- How to Check Ubuntu Version in Terminal?
- How to Upgrade from Ubuntu 18.04 to Ubuntu 20.04 LTS?
- How to Upgrade from Ubuntu 20.04 LTS to Ubuntu 22.04 LTS?
- How to Upgrade from Ubuntu 22.04 to Ubuntu 23.04?
- How to Upgrade PHP Version from 8.1 to 8.2 in Ubuntu?
- Ubuntu PHP bz2 Extension Install Commands Example
- How to Install PHP imap Extension in Ubuntu?
- How to Check Current PHP Version in Ubuntu?
- How to Whitelist/Allow IP Address in Apache Ubuntu?
- How to Install Phpmyadmin in Ubuntu Server?
- How to Connect SSH using ppk File Ubuntu?
- How to Connect to a Remote Server using SSH on Ubuntu?
- How to Upgrade PHP Version from 7.3 to 7.4 in Ubuntu?
- How to create quick apache virtual host in Ubuntu?