If you don’t comprehend, let me assure you that the Lamp Stack is open-source software that is used to host web apps and dynamic web pages. This all happens in the Linux environment. Well, Lamp also an acronym that is related to Linux. L stands for Linux, A stand for Apache webserver. M stands for the MySQL database where the site data is stored, P stands for PHP that processes the dynamic data in the whole process.
In this guide, you will learn how to install Lamp Ubuntu?
- Update Your System
- Install MySQL
- Install Apache Server
- Install PHP
- Install Phpmyadmin
- Restart Server
Before even starting, let’s have a look at the things that you need to have to install the Lump stack into your system.
- Ubuntu 18.04 server
- Non-root sudo-enabled user account
- A basic firewall
1.Update Your System
You have to update the system so that you may be able to install the latest packages for the PHP, Apache, and MySQL database.
sudo apt-get update
Enter this command in the terminal and wait for the system to get updates. You should have connected to the internet for this.
2. Install Mysql
Once you have updated the system, you can install the packages for the Lamp installation on Ubuntu. To install Mysql, you have to enter the following command.
sudo apt-get install MySQL-server MySQL-client libmysqlclient-dev
3. Install Apache Server
As to install the Lamp on Ubuntu, you have to install a bunch of packages; Apache server is one of them. You can install the Apache server using the following command.
sudo apt-get install apache2
4. Install PHP
It’s time to install the PHP, for that you have to enter the following command in the terminal.
sudo apt-get install libapache2-mod-php7.0 php7.0 php7.0-common php7.0-curl php7.0- dev php7.0-gd php-pear php-imagick php7.0-mcrypt php7.0-mysql php7.0-ps php7.0-xsl
After installing PHP in your Ubuntu for installing Lamp, you can take a look, if it is working fine or not. Here is the command that you should enter to check if it is working fine.
php -r 'echo"\n\nYour PHP installation is working fine.\n\n\n";'
5. Install Phpmyadmin
For your database, you have to install PHPMyAdmin. For that, you have to enter the following command.
sudo apt-get install PHPMyAdmin
6. Restart Server
After the installation of PHP and Mysql, the server should be restarted automatically; if it doesn’t, then you have to restart it manually before going into the further process.
sudo service apache2 restart
Just follow the above steps and install Lamp on your Ubuntu. If you face any issue while dealing with the installation process, ask in the comment section, we will try our most salutary to give you the best solution.