Upgrade PHP in NGINX
In this post, I will explain to you how we can upgrade the PHP version to the latest version. With the help of this post, you are able to update to PHP version on the ubuntu server.
Add PPA to install PHP 7.4
Add the ondrej/php
which has the latest PHP 7.4 package and other required PHP extensions.
sudo apt install software-properties-common
sudo add-apt-repository ppa:ondrej/php
sudo apt update
Once the installation is done you ready to install PHP latest version.
Step 1. Login to the server using a terminal.
Step 2. To upgrade in NGINX we need to install FPM, execute the below command to install PHP FPM 7.4
sudo apt install php7.4-fpm
Step 3. Once the installation is complete you can check your PHP version using php -v
.
How to Install PHP 7.4 extension
Extension installation in PHP is very easy you can run below command to install PHP extension in your server.
sudo apt install php7.4-selected_extension
If you want to upgrade PHP in Apache server you can follow this post: