Categories: LinuxUbuntu

Install PHP on Ubuntu 20.04 or 20.10

Make sure your Ubuntu is up to date and patched.

$ sudo apt update
$ sudo apt upgrade

PHP is available within Ubuntu’s default software repositories, making it possible to install it using conventional package management tools. After confirming the installation, apt will install PHP and all required dependencies.

$ sudo apt install php -y
$ php -v

# Returns an error in fresh install
Command 'php' not found, but can be installed with:
sudo apt install php7.4-cli

# Returns PHP version
PHP 7.4.3 (cli) (built: May 26 2020 12:24:22) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
    with Zend OPcache v7.4.3, Copyright (c), by Zend Technologies

PHP extensions are compiled libraries that extend the core functionality of PHP. Extensions are available as packages and can be easily installed with:

$ sudo apt-get install -y php-{curl,dom,fileinfo,gd,iconv,intl,json,mbstring,pdo,phar,simplexml,xml,zip}

Have fun!

Emre KARABULUT

Hi, I’m Emre KARABULUT, 29, and I am the owner of a small (but perfectly formed) design studio called Minimalist Art & Design based in Istanbul, which specialises in Blog and User Interface design. I help entrepreneurs and small business owners create a unique brand and online presence which gives them a powerful platform to reach out to their customers and markets.

Recent Posts

Authenticating with the Apple Search Ads API

There are many methods for using APIs. In order to understand it better, lets take…

3 years ago

How To Add Swap Space on Ubuntu 20.04 or 20.10

One way to guard against out-of-memory errors in applications is to add some swap space.…

4 years ago

Install Docker-Compose on Ubuntu 20.04 or 20.10

Docker Compose is a tool that allows you to run multi-container application environments based on…

4 years ago

Shopware 6 – Local installation in Ubuntu 20.04 or 20.10

After the creation of development environment your setup fulfills the Shopware 6 requirements. If you…

4 years ago

Shopware 6 – Docker installation in Ubuntu 20.04 or 20.10

After the creation of development environment your setup fulfills the Shopware 6 requirements. If you…

4 years ago

Shopware 6 – Installing System Requirements in Ubuntu 20.04 or 20.10

To create a development environment in fresh install of Linux - Ubuntu 20.04 (Focal Fossa)…

4 years ago