How to Install PHP, MySql, Apache (LAMP) in Ubuntu. If you are using Linux or any Linux distros such as ( Ubuntu,Kubuntu etc) you can install LAMP easily using single command .
In this article i’m going to teach how to install PHP, MySql, Apache in Ubuntu using tasksel.
What is LAMP
LAMP is basically Linux,Apache,MySql and PHP used for web development. It’s a combination of operating system and open-source software stack . Similarly for Windows operating system WAMP is available and if you are using Mac os then install MAMP package.
How To Install PHP, MySql, Apache (LAMP) in Ubuntu
The most easy way to install Apache,PHP,Mysql on Ubuntu is to use tasksel. Tasksel groups some packages by tasks and offers the user an easy way to install the packages for that task.
Let’s install LAMP stack using tasksel.
1 2 3 |
$ sudo apt-get update $ sudo apt-get install tasksel |
Once it is install type tasksel command and press enter
1 |
$ sudo tasksel |
It can open the package configuration box. Select the LAMP Server and then press ok.
Now you have done. It is one of the easiest and best way to install PHP,Apache,MySql in your system.
How to install phpMyAdmin on Ubuntu.
How to Install LAMP Server on Ubuntu
We have learnt how to install LAMP using tasksel. You can also install LAMP bundle using terminal directly.
Update the apt-get package.
1 |
$ sudo apt-get update |
If you are not familiar about apt-get package manager in Ubuntu then read my previous tutorial about how to install,uninstall,remove,update package through apt-get package manager.
Install the LAMP server.
1 |
$ sudo apt-get installs lamp-server^ |
Now installation is done. You can check whether PHP has installed successfully or not by creating test.php file /var/www/html (which is the document root) directory.
In test.php file write following script.
1 2 3 4 5 |
<?php phpinfo(); ?> |
Open this file in your web-browser by using this url (http://localhost/test.php). You’ll see PHP configuration file.
If you are beginner learning Linux, check most useful linux command for beginners.