Install LAMP to Ubuntu

Posted under » PHP » MySQL » Ubuntu » Apache on 10 March 2012

Installing LAMP (Linux-Apache-MySQL-PHP) used to be a tedius affair. Now things are much simpler.

Installing Lamp Server components individually via apt-get

AKA "the hard way". Install Apache first.

apt-get install apache2

Then MySQL

apt-get install mysql-server

Then PHP

apt-get install php5 libapache2-mod-php5 php5-common

MySQLi error : Sometimes this for some reason MySQLi wasn't found. Then reinstall this

apt-get install php5-mysql

My experience is that sometimes the "MySQLi not found" shit will not go away.. So its best that we go the automated way below.

By just one command

This works great on Ubuntu 20.04 and above.

apt-get install lamp-server^

If you want to install nginx instead use lemp-server. If for some reason nothing happens.

apt-get install tasksel
tasksel

You have to restart the Apache service if you want MySQL to start

Test

<¿php 
phpinfo();
?>

For instructions on windows installation, please read here. For the official documentation.

You may wish to proceed in other PHP libraries.
 

web security linux ubuntu python django git Raspberry apache mysql php drupal cake javascript css AWS data