Install PHP-FPM with Apache on Ubuntu 22.04 Code Example

03-Apr-2023

.

Admin

Install PHP-FPM with Apache on Ubuntu 22.04 Code Example

Hi Guys

This post will give you example of Install PHP-FPM with Apache on Ubuntu 22.04 Code Example. We will look at example of Do I Start PHO on Ubuntu 22.04?. I explained simply step by step Tutorial Install and Configure PHP on Ubuntu 22.04. This article will give you simple example of Install all php extensions ubuntu 22.04 Code Example.

You can use this post for ubuntu 14.04, ubuntu 16.04, ubuntu 18.4, ubuntu 20.04, ubuntu 21 and ubuntu 22.04 versions.

We’ll discuss how to add the PPA on ubuntu with install PHP 7.2 or PHP 7.3.

Step 1: Install PHP 7.2


Before install PHP, We’ll add the PPA For PHP 7.2

sudo apt-get install python-software-properties -y

sudo add-apt-repository ppa:ondrej/php

First update the apt package :

sudo apt-get update

Install The PHP 7.2 On Ubuntu with the below command :

sudo apt-get install php7.2

Step 2: Test Installed PHP Version

Use the below command to check the PHP version installed on your server :

php -v

Install PHP 7.2 Extensions

sudo apt-get install php7.2-<extension-name>

See example below

sudo apt-get install php7.2-fpm php7.2-curl php7.2-mysql \ php7.2-xml php7.2-zip php7.2-gd

Step 3: Install PHP 7.3

Before install PHP 7.3, We’ll add the PPA For PHP 7.3

sudo apt-get install python-software-properties -y

sudo add-apt-repository ppa:ondrej/php

Installing the PHP on Ubuntu with PHP Version 7.3. First update the apt package :

sudo apt-get update

Install The PHP On Ubuntu with the below command :

sudo apt-get install php7.3

Step 4: Test Installed PHP Version

Use the below command to check the PHP version installed on your server :

php -v

Install PHP 7.3 Extensions

sudo apt-get install php7.3-<extension-name>

See example below

sudo apt-get install php7.3-fpm php7.3-curl php7.3-mysql \ php7.3-xml php7.3-zip php7.3-gd

#Ubuntu