How To Install PHP 7.4, 7.3, 7.2 & 7.1 on Ubuntu 19.10
The PHP Version 7.4.0 has been released on November 28, 2019. PHP 7.4 comes with a remarkable amount of new features. PHP is an open-source server scripting language use for creating dynamic web applications and websites. PHP is a widely-used programming language in the Web. You can also check more features in the PHP official site.
Useful Articles:
- HOW TO INSTALL PHP 7.4, 7.3, 7.2, 7.1 ON CENTOS/RHEL 8
- HOW TO INSTALL PHP 7.4, 7.3, 7.2, 7.1 ON CENTOS/RHEL 7/6
- ENABLE PHP ERRORS TO DISPLAY ON WEB BROWSER
- HOW TO DOWNGRADE PHP 7.1 TO 5.6 ON UBUNTU
- HOW TO UPGRADE PHP 5.6 TO 7.1 ON UBUNTU
- INSTALL LAMP (APACHE 2.4, MYSQL 5.6, AND PHP 7.0) ON CENTOS/RHEL 7
- INSTALL PHP7 ON UBUNTU SERVER 15.10, 15.04 & 14.04 USING PPA
Use the following steps to install PHP 7.4 on Ubuntu 19.04/18.04/16.04.
Add PHP PPA Repository
First, we’ll add the PHP repository to install the PHP. Use mention commands to add the PHP repository.
$ sudo apt-get update $ sudo apt -y install software-properties-common $ sudo add-apt-repository ppa:ondrej/php $ sudo apt-get update
Install PHP on Ubuntu
Now, you are ready to install PHP based on your requirement. In this article, we will install the PHP 7.4
## Install PHP 7.4 ##
$ apt -y install php7.4
## Install PHP 7.3 ##
$ apt -y install php7.3
## Install PHP 7.2 ##
$ apt -y install php7.2
## Install PHP 7.1 ##
$ apt -y install php7.1
I have installed PHP 7.4 on my system. Now you are ready to run the following command to check PHP version on my system.
$ php -v
PHP 7.4.5 (cli) (built: Apr 19 2020 07:36:46) ( NTS ) Copyright (c) The PHP Group Zend Engine v3.4.0, Copyright (c) Zend Technologies with Zend OPcache v7.4.5, Copyright (c), by Zend Technologies
Use the next command to install additional packages:
$ sudo apt-get install php7.4-{xml,soap,xmlrpc,mbstring,json,gd,mcrypt,zip,intl}
PHP configurations related to Apache file is stored in /etc/php/7.4/apache2/php.ini
Enjoy it!