How to Install PHP on Ubuntu 18.04

How to Install PHP on Ubuntu 18.04

PHP is one of the most popular programming language currently in the world. PHP has different versions 5.6, 7.0, 7.1 and 7.2. Ubuntu 18.04 ships with default PHP 7.2 support, We can easily install PHP 7.2 on Ubuntu. Ubuntu 18.04 is the current latest version of Ubuntu. This tutorial outlines how to install PHP 7.2 on Ubuntu 18.04.

Install PHP on Ubuntu 18.04

PHP is one of the most popular programming language currently in the world. PHP has different versions 5.6, 7.0, 7.1 and 7.2. Ubuntu 18.04 ships with default PHP 7.2 support, We can easily install PHP 7.2 on Ubuntu. Ubuntu 18.04 is the current latest version of Ubuntu. This tutorial outlines how to install PHP 7.2 on Ubuntu 18.04.


Prerequisites

Before you start installing PHP on Ubuntu 18.04. You must have a non-root user account on your server with sudo privileges.


How to Install PHP 7.0 on Ubuntu 18.04

Update the apt package manager index typing following command:

sudo apt update

Run the following command to install PHP on your server. The following command will install php7.2.

sudo apt install php7.0

Check PHP version and confirm the installation by running following command

php -v

Following are some basic PHP extensions needs to be installed on your server

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

How to Install PHP 7.2 on Ubuntu 18.04

Update the apt package manager index typing following command:

sudo apt update

Run the following command to install PHP on your server. The following command will install php7.2.

sudo apt install php7.2

Check PHP version and confirm the installation by running following command


php -v

Following are some basic PHP extensions needs to be installed on your server

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

Conclusion

In this tutorial, you have learned how to install PHP on Ubuntu 18.04 successfully with some of its basic extensions useful for frameworks and tested successfully. If you have any of the queries regarding this then you can comment below.

php ubuntu

Bootstrap 5 Complete Course with Examples

Bootstrap 5 Tutorial - Bootstrap 5 Crash Course for Beginners

Nest.JS Tutorial for Beginners

Hello Vue 3: A First Look at Vue 3 and the Composition API

Building a simple Applications with Vue 3

Deno Crash Course: Explore Deno and Create a full REST API with Deno

How to Build a Real-time Chat App with Deno and WebSockets

Convert HTML to Markdown Online

HTML entity encoder decoder Online

How to Install Microsoft Teams on Ubuntu 20.04

In this tutorial, we will show you how to install Microsoft Teams on Ubuntu 20.04 machine. we can install teams using Debian installer file or by adding microsoft repository.

Hire PHP Developer

Looking to develop a PHP based website from scratch or revamp your existing website? **[HourlyDeveloper.io](https://hourlydeveloper.io/ "HourlyDeveloper.io")** has always been an industry leader for companies and business owners looking to hire...

Hire Dedicated PHP Developer

Looking to hire affordable yet experienced PHP developers? **[Hire Dedicated PHP Developer](https://hourlydeveloper.io/hire-dedicated-php-developer/ "Hire Dedicated PHP Developer")**, who can convert your idea to reality, within the stipulated...

How to Install PHP on Ubuntu 20.04

This guide covers the steps necessary to install PHP on Ubuntu 20.04 and integrate it with Nginx and Apache. At the time of writing, the default Ubuntu 20.04 repositories include PHP 7.4 version. We’ll also show you how to install previous PHP versions. Before choosing which version of PHP to install, make sure that your applications support it.

Country State City Dropdown list in PHP MySQL PHP

Country state city dropdown using ajax in php. You'll learn how to populate country city state dropdown based on previous selection in php using ajax