What is a LAMP Stack?
A LAMP (Linux, Apache, MySQL, PHP) stack is a common, free, and open-source web stack used for hosting web content in a Linux environment. Many consider it the platform of choice on which to develop and deploy high-performance web apps.
This guide shows how to install and test a LAMP stack on Ubuntu 18.04 (LTS).
Install LAMP Ubuntu 18.04
Using the tasksel
command the procedure of installing LAMP on Ubuntu 18.04 Bionic Beaver is a rather trivial matter. First, make sure that you have the tasksel
package installed:
$ sudo apt install tasksel
To install LAMP server using tasksel
execute:
$ sudo tasksel install lamp-server
Test your LAMP Install
Create a simple PHP Info page to test your LAMP installation:
$ sudo bash -c "echo -e '<?php\nphpinfo();\n?>' > /var/www/html/phpinfo.php"
The above command will create a new /var/www/html/phpinfo.php
file with the following content:
$ cat /var/www/html/phpinfo.php <?php phpinfo(); ?>