How to install PHP7 in Ubuntu 16.04?
Introduction
PHP is a server side scripting language that is used to create dynamic web applications.
In this tutorial, we are installing and configuring PHP7 so that we can develop PHP based web applications.
This process includes the following steps.
1) Check PHP is available
It shows that PHP is not installed.
2) Install PHP
Now, install it using following command. It will install PHP latest version by default.
3) Verify PHP
Use the following command to check PHP version. It will show PHP version details only when it is installed.
Now, it shows PHP version. It means we have installed PHP successfully.
Extra Info
To test, PHP is working properly. We can execute it over the browser using apache server.
Create a file first.php inside the /var/www/html directory that contains the following code.
// first.php
Now, execute this file using localhost/first.php over the browser. It will produce the following output to the browser.