How To Install Linux, Apache, MySQL and PHP (LAMP Stack)

What Is A LAMP Stack?
A LAMP stack is a set of four popular opensource components for web development.
Each of the letters in the LAMP acronym stands for one of the components:

  • Linux is the operating system in the stack.
  • Apache is the web server in the stack.
  • MySQL is the database in the stack.
  • PHP is the programming language in the stack.

sudo apt update – is optional use to update apt repository

Install Apache

sudo apt install apache2 -y

apache2 -v (check version)

Install MySQL

apt install mysql-server -y

mysql -V (check version)

Install PHP
Now we can install the scripting language of our LAMP stack. Specifically, we will install 3 packages:

  • php is the default package for the PHP scripting language
  • libapache2-mod-php is the PHP module for Apache
  • php-mysql is the PHP module for MySQL
    To install all 3 packages, run this command:

Leave a Reply

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