

- Ubuntu 20.04 php 8.1 how to#
- Ubuntu 20.04 php 8.1 install#
- Ubuntu 20.04 php 8.1 update#
- Ubuntu 20.04 php 8.1 upgrade#
There are 4 choices for the alternative php (providing /usr/bin/php). It will show the default PHP version selection option. Run below command to change the default version for CLI and Apache sudo update-alternatives -config php If you want to change the default PHP version, use ‘update-alternatives’ command.
Ubuntu 20.04 php 8.1 how to#
How to Switch Default PHP Versions on Ubuntu If you are using other versions, just replace the version number (8.2) with your installed version. PHP Active modules configuration directory location:

Important PHP configuration files location:Īll the installed PHP modules are stored under /etc/php/8.2/mods-available directory. Let me consider, you installed PHP version 8.2 on your Ubuntu system, then all the configuration files will be at following location: PHP configuration files location on Ubuntu 22.04 In our case, PHP configuration files such as (php.ini) file and other PHP configuration files are stored under /etc/php directory with installed version numbers. The location of PHP configuration files can vary depending on the operating system, web server, and PHP version you are using. php -v PHP Configurations Files Location on the Ubuntu System Run below command to check the version of PHP. Now, after installation check your installed PHP version is whether correct or not.
Ubuntu 20.04 php 8.1 install#
sudo apt install php8.2-mysql php8.2-mbstring php8.2-xml php8.2-curl php8.2-gd php8.2-xmlrpc php8.2-soap php8.2-intl, php8.2-zipĬhange your version number according to your installation. Let’s install php extensions at once by below command. Php-mysql, php-mbstring, php-xml, php-curl, php-gd, php-xmlrpc, php-soap, php-intl, php-zip Let’s install those PHP extensions.įor WordPress, you will need following extensions. In that case, I will require some PHP extensions to run it properly on the server. Let me consider I am installing WordPress on Ubuntu server. Most of the PHP Applications or frameworks need various PHP Extensions to run the application on Ubuntu. You can install multiple PHP versions on single Ubuntu system for different PHP applications as needed. Just replace the version number as above shown, you can install PHP on Ubuntu 22.04 as required. Install PHP 8.2 (Latest Version) sudo apt install php8.2 Install PHP 8.1 sudo apt install php8.1 Install PHP 7.4 sudo apt install php7.4 Install PHP 5.6 (End of Life) sudo apt install php5.6 Use following commands to install your required version. Remember till now, most of the websites still require PHP 7, although PHP 8.2 is latest stable version.
Ubuntu 20.04 php 8.1 update#
sudo apt update Step 4: Install PHP on Ubuntu 22.04 (Any Version) Now, update package manager using following command. On running this command, it will ask for permission. LC_ALL=C.UTF-8 sudo add-apt-repository ppa:ondrej/php Ondrej PPA contains all the versions of PHP, add the package using following command. Install required dependencies by following command to continue with PHP installation on Ubuntu 22.04 sudo apt install software-properties-common ca-certificates lsb-release apt-transport-https Step 2: Add Ondrej PPA to the sytem Following should be the desired output Install PHP on Ubuntu 22.04 ( Latest Version or Specific Version)įor installing latest PHP version or any required version, first we need to install a few dependencies followed by adding Ondrej PPA to the system, we can install any required version, be it latest or specific version of our choice. It will show the installed version of PHP. To check the installed version, run following php version check command. It will install the prepackaged version of PHP, remember as I said earlier it may not be the latest version or specific PHP version you want. Just you have to run following command to install PHP on Ubuntu. If you are not looking for specific version, PHP installation is pretty straight forward.
Ubuntu 20.04 php 8.1 upgrade#
To update and upgrade the system with latest packages, run following command: sudo apt update & sudo apt upgrade How to Switch Default PHP Versions on UbuntuĪlways remember to update and upgrade your system before doing any system changes in Ubuntu or any Linux based operating system.PHP configuration files location on Ubuntu 22.04.PHP Configurations Files Location on the Ubuntu System.

Step 4: Install PHP on Ubuntu 22.04 (Any Version).Install PHP on Ubuntu 22.04 ( Latest Version or Specific Version).
