Installing Linux, Apache, MySQL and PHP (LAMP) on Ubuntu
Installing Default LAMP Package on Ubuntu
If you want to install LAMP in the easiest way, you need to type the following codes into the terminal.
sudo apt-get update sudo apt-get install lamp-server^
Don't forget to type the "^" character, otherwise you will fail.
Installing Linux, Apache, MySQL, PHP on Ubuntu
If you want to install them all separately, you're in the right place. While this is a bit more work, it gives you better usability and the ability to install what you want.
Apache Installation
sudo apt-get update sudo apt-get install apache2
That's it. Apache is installed. To check, type http://localhost into your web browser; if you see "Working!", it should install without any problems. If you're installing on a VPS server, you'll need to enter your VPS's IP address in your browser.
MySQL Installation
sudo apt-get install mysql-server
You will be asked to enter the root password of the MySQL user.
PHP Installation
sudo apt-get install php libapache2-mod-php php-mcrypt php-mysql
That's all.
Installing PHP Modules
To list PHP modules, type the following code in the terminal.
apt-cache search php5-
If you want to install one of these, you can install it by typing the following code in the terminal.
sudo apt-get module name sudo apt-get php5-cli