How To Install LAMP (Linux, Apache, MySQL, PHP) on Ubuntu Operating System

LAMP (Linux, Apache, MySQL, PHP) is an open source Web development platform that uses Linux, Apache as the Web server, MySQL as the relational database management system and PHP as the object-oriented scripting language.
  • Linux: Linux is a operating system assembled under the model of free and open source software development.
  • Apache: Apache HTTP Server has been the most popular web server on the public Internet
  • MySQL: MySQL is original role as the LAMP’s relational database management system (RDBMS).
  • PHP: PHP is a server-side scripting language designed for web development and create build dynamic webpages. PHP code is interpreted by a web server via a PHP processor module, which generates the resulting web page.

Step 1: Installing Apache 2

It provides a full range of web server features including CGI, SSL and virtual domains. Open the terminal and type commands:
It requires a restart for it to work:
Open your browser and type: (eg. http://127.0.0.1).
How to Find your Server’s IP address
You can run command this command.

Step 2: Installing MYSQL with PHP 5

Open terminal and type in these commands:
During installation, you will be asked to setup the MySQL “root” user password. Enter the password and click Ok. Once you have installed MySQL, we should activate it with this command:
Also, you set manually password manually use thsi command:
The prompt will ask you for your current root password. Type it in:
Prompt will ask you if you want to change the root password.

Step 3: Installing PHP 5

Open terminal and type in this command.
LAMP is installed, creating a quick php info page
sudo nano /var/www/test.php
Add in following line:
Then Save and Exit.
Restart apache: