Fastest Way to Install PHP 7.4 in Ubuntu 20.04 (Nginx Version)

Arif
1 min readAug 12, 2021

PHP 7.2 is the latest stable release of PHP on Ubuntu 18.04. But, not in 20.04 LTS. Perform the steps below to install PHP 7.4 on on Ubuntu 20.04.

  1. Start by enabling the Ondrej PHP repository:
sudo apt install software-properties-common
sudo add-apt-repository ppa:ondrej/php
sudo apt update

2. Install PHP 7.4 and some of the most common PHP modules:

sudo apt install php7.4 php7.4-common php7.4-opcache php7.4-cli php7.4-gd php7.4-curl php7.4-mysql php7.4-fpm php7.4-zip php7.4-gd php7.4-bcmath php7.4-imagick php7.4-cli

3. To verify the installation, run the following command which will print the PHP version:

12:30 deployer@vm-devServer-ub18-851 ~% php -v
PHP 7.4.16 (cli) (built: Mar 5 2021 07:54:20) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
with Zend OPcache v7.4.16, Copyright (c), by Zend Technologies

Conclusion

You have successfully installed PHP 7.4 for NGINX on your Ubuntu 20.04 server.

--

--

Arif
Arif

Written by Arif

Blue Team at Indonesian SOCs

No responses yet