How To Install Apache MySQL PHP (LAMP Stack) on Ubuntu 16.04

How To Install Apache MySQL PHP (LAMP Stack) on Ubuntu 16.04

Introduction

A LAMP (Linux, Apache, MySQL and PHP ) Stack is the most popular environment in PHP website development and hosting.

  • Linux is the operating system,
  • Apache is the popular web server developed by Apache Foundation.
  • MySQL is relational database management system used for storing data
  • PHP is an development language.

This article will help you to Install Apache 2.4, MySQL 5.7 and PHP 7.0 . on Ubuntu 16.04 LTS Systems.

Step 1 – Install PHP

PHP 7 is the default available packages in Ubuntu 16.04 repositories. Simply use the following commands to update apt cache and install PHP packages on your system.

Before you begin Update your system:

$ sudo apt update && apt dist-upgrade -yy

Then:

$ sudo apt install php

Verify installed PHP version using following command.

$ php -v
PHP 7.0.15-0ubuntu0.16.04.4 (cli) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies
with Zend OPcache v7.0.15-0ubuntu0.16.04.4, Copyright (c) 1999-2017, by Zend Technologies

Optionally, install additional cURL, JSON, and CGI support::

$ sudo  apt install php7.0-curl php7.0-json php7.0-cgi

Step 2 – Install Apache2

After installing PHP on your system, let’s start installation of Apache2 in your system.

$ sudo  apt install apache2

Your also required to install libapache2-mod-php module to work PHP with Apache2.

$ sudo  apt install php-pear libapache2-mod-php7.0

Step 3 – Install MySQL

After installing PHP on your system, let’s start installation of Apache2 in your system.

$ sudo  apt install mysql-server

Your also required to install php7.0-mysql module to work PHP with MySQL.

$ sudo  apt install php7.0-mysql

 

Leave a Reply

Your email address will not be published. Required fields are marked *