How to install php7.4 on Linux (Ubuntu)

WSL2 This is the procedure to install PHP7.4 on Ubuntu 20.04.

Development environment

Host OS: WIndows10 home Guest OS: WSL2 Ubuntu 20.04

Installation procedure

Execute the following command.

① Check the package update

$ sudo apt update 

(2) Install the software-properties-common package.

$ sudo apt install software-properties-common

I want to add a repository in ③, but the command to add a repository is not installed by default. The packages installed here are for adding repositories.

③ Add a repository

$ sudo add-apt-repository ppa:ondrej/php

④ Update the package again. (① Same procedure)

⑤ Install PHP

$ sudo apt install php7.4

After checking the version, if the following is displayed, the installation is complete.

$ php -v

PHP 7.4.7 (cli) (built: Jun 12 2020 07:44:38) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
    with Zend OPcache v7.4.7, Copyright (c), by Zend Technologies

Finally, check the installation location of php.

$ which php
/usr/bin/php

(Not found with the find command. Why ...)

Recommended Posts

How to install php7.4 on Linux (Ubuntu)
How to install VMware-Tools on Linux
How to install MBDyn (Linux Ubuntu)
How to install Go on Ubuntu
How to install aws-session-manager-plugin on Manajro Linux
How to update php on Amazon linux 2
How to install Anisble on Amazon Linux 2
How to install Camunda Modeler on Manjaro Linux
How to build Java environment on Ubuntu (Linux)
How to install Linux on a 32bit UEFI PC
[AWS EC2] How to install Maven on Amazon Linux 2
How to install git on Linux such as EC2
How to install mysql-connector-python on mac
How to install graph-tool on macOS
How to install wkhtmltopdf (Amazon Linux2)
How to install pycrypto on Windows
How to install OpenCV on Mac
How to install PyPy on CentOS
How to install TensorFlow on CentOS 7
How to install Maven on CentOS
How to install music 21 on windows
How to install drobertadams / toggl-cli on Mac
Steps to install Python environment on Ubuntu
How to display emoji on Manjaro Linux
5 reasons to install Linux on your laptop.
How to install richzhang / colorization on Windows 10
How to install Windows Subsystem For Linux
How to update security on CentOS Linux 8
How to install Apache (httpd) on CentOS7
How to install Eclipse GlassFish 5.1.0 on CentOS 7
On Ubuntu Linux, set Tab to q
How to install Apache (httpd) on CentOS8
How to find large files on Linux
How to install NumPy on Raspberry Pi
How to install cx_Oracle on macOS Sierra
Install TensorFlow on Ubuntu
How to install Python
How to install python
Install PySide2 on Ubuntu
Install JModelica on Ubuntu
How to install Nbextensions
Install Python 3.3 on Ubuntu 12.04
Install Theano on Ubuntu 12.04
How to install Prover9
Install angr on Ubuntu 18.04
Install pip / pip3 on Ubuntu
[2020 version] How to install Python3 on AWS EC2
How to install OpenCV on Jetson Nano Python
[Latest] How to build Java environment on Ubuntu
[Note] Install wxPython 3.x on Linux Mint (Ubuntu)
How to update security on Ubuntu 19.10 Eoan Ermine
How to quickly install h5py on Windows 10 [Unofficial]
[Python] How to install OpenCV on Anaconda [Windows]
Install PHP 7 series on Amazon Linux 2 with Amazon Linux Extras
How to install / verify graphviz on anaconda / windows10
[2020.8 latest] How to install Python
How to install Python [Windows]
Install Linux on your Chromebox
How to use C216 Audio Controller on Arch Linux
Tabpy 1.0 (2020-01 version) How to install
How to install Git GUI and Gitk on CentOS