Install LAMP In Ubuntu
LAMP is an archetypal model of web
In this article, I will explain how to install LAMP stack in Ubuntu 18.04. Without further delay let’s get started before that if you guys are enjoying my articles please make sure you share it with your friends 🙂 so Let’s Start.
1. Install Apache
In LAMP, Our first step is to install Apache. To install Apache you must install the Metapackage apache2. Which can be done by searching in its software center or by running the following command.
sudo apt-get install apache2
2. Install My SQL
My SQL can be used for managing databases (Creating, Dropping, Renaming etc). To install My SQL you must install the Metapackage mysql-server. Which can be done by searching in its software center/over the internet or by running the following command.
sudo apt-get install mysql-server
3. Install PHP
PHP (Hypertext Preprocessor) is a popular general-purpose
sudo apt install php-pear php-fpm php-dev php-zip php-curl php-xmlrpc php-gd php-mysql php-mbstring php-xml libapache2-mod-php
4. Restart Server
Your server should restart Apache automatically after the installation of both MySQL and PHP. If it doesn’t, execute this command to run it manually.
sudo service apache2 restart
5. Check Apache (If It’s Running Or Not)
Open a web browser and navigate to http://localhost/. If you see the apache default web page, it means your installation is working fine.
fig. Ubuntu Default Apache Page On Localhost
6. Check PHP (If It’s Running)
Now, Let’s create a PHP file to check if your PHP is working or not. Follow the steps to create a PHP file from command line to your /var/www/html (localhost server directory) folder.
cd /var/www/html && vi /var/www/html/info.php
Now, Press Insert button on your keyboard and type the following content under your info.php
<?php phpinfo(); ?>
Note:- :wq! to save and exit from vi editor.
Now, Run http://localhost/info.php on your web browser (Firefox, chrome, safari etc.) if you’re seeing PHP information then PHP is installed on your computer successfully.
That’s it! In this article, I have explained How to install LAMP on Ubuntu 18.04 ? Thank You For Reading This Article, Let me know your comments what’s your thought in this article.