Install LAMP (Apache 2.4, MySQL 5.6, and PHP 7.0) on Ubuntu using PPA

LAMP stands for Linux, Apache, MySQL and PHP. A “LAMP” stack is a gathering of open source software that is normally installed together to enable a server to host dynamic sites and web applications. I will demonstrate to you best practices to introduce a LAMP system. The guide is intended to help the individuals who have assistance with having next to no information of using Linux.
Install LAMP

Apache Server

Apache (HTTPD) is the most popular web server used on Linux systems. Lets follow following steps of install Apache Server:

Install Apache Server
Apache will be installed with default ubuntu repositories, run the following command to install apache on ubuntu system:

# sudo apt-get update
# sudo apt-get install apache2

Start Apache Service
Now start apache service using below commands.

For Ubuntu 15.04/15.10:
# sudo systemctl restart apache2.service
For Ubuntu 14.04/14.10:
# sudo service apache2 restart

Verify Version
Run the following command verify the version:

# apache2 -v
Server version: Apache/2.4.7 (Ubuntu)
Server built:   Oct 14 2015 14:20:21

PHP

The PHP development team announces the immediate availability of PHP 7.0. Several bugs have been fixed. PHP 7.0.0 comes with a new version of the Zend Engine, numerous improvements and new features.

Add PPA Repository:
Say thanks to Ondřej Surý for maintaining PPA of most the popular PHP versions. Use the following command to add PPA for PHP 7

# sudo add-apt-repository ppa:ondrej/php-7.0

Install PHP7:
Now install PHP 7 using following command:

# sudo apt-get update
# sudo apt-get install -y php7.0

Now install required php modules. Use following command to list available modules and install it.

# apt-cache search php7

Now run the following command to install all required modules:

# apt-get install php70w-common php70w-xml php70w-soap php70w-xmlrpc php70w-mysql
# apt-get install php70w-mbstring php70w-gd php70w-mcrypt

Restart Apache Service
After installing php and other php modules restart Apache service.

For Ubuntu 15.04/15.10:
# sudo systemctl restart apache2.service
For Ubuntu 14.04/14.10:
# sudo service apache2 restart

Verify Version
Run the following command verify the version:

# php -v
PHP 7.0.1-2+deb.sury.org~trusty+1 (cli) ( NTS )
Copyright (c) 1997-2015 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2015 Zend Technologies
    with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2015, by Zend Technologies

MySQL

MySQL is an open source relational database management system (RDBMS) based on Structured Query Language (SQL).

Install MySQL:
Now install MySQL server and other dependency packages.

# apt-get install mysql-server-5.6

At the time of installation a dialogue box will show:
root_pass

repeat_pass

Restart MySQL Service
Now restart MySQL service using below commands.

For Ubuntu 15.04/15.10:
# sudo systemctl restart mysqld.service
For Ubuntu 14.04/14.10:
# sudo service mysqld restart

Verify Version
Run the following command verify the version:

# mysql -V
mysql  Ver 14.14 Distrib 5.6.27, for debian-linux-gnu (x86_64) using  EditLine wrapper

Enjoy it!

No Responses

Leave a Reply

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

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

The reCAPTCHA verification period has expired. Please reload the page.