2.3. Installing on Linux (Ubuntu)

In order to install PHP in Ubuntu, you should use the apt-get package manager. You must first update the information about the repositories and current packages using the commands:

$ sudo apt-get update
$ sudo apt-get upgrade

You can then proceed with the installation:

$ sudo apt-get install php7.0

After successful installation, the php command should be available anywhere on the computer:

$ php -v
РНР 7.0.15-0uЬuntu0.16.04.4 (cli) ( NТS )
Copyright (с) 1997-2017 The РНР Group
Zend Engine vЗ.0.0, Copyright (с) 1998-2017 Zend Technologies
with Zend OPcache v7.0.15-0uЬuntu0.16.04.4, Copyright (с) 1999-2017,
bу Zend Technologies