PHP Configuration For Ubuntu


Before starting with this tutorial, make sure you are logged in as a sudo user .

Start by enabling the Ondrej PHP repository:

sudo apt install software-properties-common
sudo add-apt-repository ppa:ondrej/php

Install PHP 7.3 and some of the most common PHP modules:

sudo apt install php7.3 php7.3-common php7.3-opcache php7.3-cli php7.3-gd php7.3-curl php7.3-mysql

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

php -v
PHP (cli) (built: Jan 13 2019 10:19:33) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.1, Copyright (c) 1998-2018 Zend Technologies
    with Zend OPcache, Copyright (c) 1999-2018, by Zend Technologies