

To do this, create a sample info.php file. The other approach is to create a PHP file in the webroot directory which will provide detailed information about the PHP version installed. The output above confirms that PHP 8.1 has successfully been installed. Once the installation is complete, run the command: $ php -v This installed PHP 8.1, Apache webserver alongside other additional packages and dependencies. To do so, use the APT package manager as shown.
#Install mysql ubuntu 20.10 install
$ sudo apt update Step 4: Install PHP 8.1 on Ubuntu 20.04 / 22.04Īt this point, the only thing left to do is to install PHP 8.1. Next, update your package lists for the system to sync with the newly added repository. To verify that the repository was added, run the command: $ sudo grep -rhE ^deb /etc/apt/sources.list* | grep -i ondrej When you get to this section, simply press ENTER to proceed with the installation. To achieve this, we will run the command: $ sudo add-apt-repository ppa:ondrej/php In order to install it, we need to add the Ondrej PHP repository which provides the latest versions of PHP. PHP 8.1 is not available on the official Ubuntu repositories. Step 3: Install Ondrej PHP repository on Ubuntu 20.04 Press ‘Y’ when prompted to continue with the installation. $ sudo apt install ca-certificates apt-transport-https software-properties-common Install the following requirements for the installation to proceed smoothly. Step 2: Install prerequisitesīefore we proceed with the installation of PHP 8.1, we need to install a few prerequisites. Our mission, however, is to install PHP 8.1, and therefore we will ignore this suggestion. Here, the terminal output points out how we can install PHP 7.4 You will then get a suggestion of how you can install PHP. If PHP is not installed, you should get a warning that ‘php’ not found. Once the package lists have been updated, you can verify if you have any version of PHP installed. Right off the bat, log in to your instance of Ubuntu and update the package index as follows: $ sudo apt update Step 1: Update Ubuntu 20.04 / Ubuntu 22.04
#Install mysql ubuntu 20.10 how to
In this guide, we will demonstrate how to install PHP 8.1 on Ubuntu 20.04 / 22.04.

Check out some of the new features provided by the latest version. It comes with its own unique set of features and deprecations. PHP 8.1 was released on November 25, 2021, and is a minor release of the PHP 8 series.
