How to install PHP on Ubuntu 18.04

In this article, I will take you through the steps to install php on Ubuntu 18.04. PHP (recursive acronym for PHP: Hypertext Preprocessor) is a widely-used open source general-purpose scripting language that is especially suited for web development and can be embedded into HTML.

Install PHP on Ubuntu

Prerequisites

Apache webserver should have already be installed.

How to install PHP on Ubuntu 18.04 1

 

Update the System

First you need to update your system using sudo apt-get update command.

How to install PHP on Ubuntu 18.04 2

Install PHP 

Now you need to install php through sudo apt-get install php command.

How to install PHP on Ubuntu 18.04 3

Check PHP Version

Once the installation is completed, Check PHP version using php –version command.

How to install PHP on Ubuntu 18.04 4

Write your First PHP Program

Congratulations PHP is now successfully installed. Let’s write our first php code and run it using php example.php command.

How to install PHP on Ubuntu 18.04 5

Also Read: How to install PHP on RedHat/CentOS 7

Advertisements

Reference: PHP Documentation

Advertisements

Leave a Reply