LAMP is refer to Linux-Apache-MySQL-PHP. For those project that involve in IT, web server and database is a common thing. Normally student will setup web server and database on their personal laptop/PC. It is a bit risky especially when you do other important stuff on the same laptop. So replacing web server on your laptop to Raspberry Pi is a better alternative.
This video will show you how to install LAMP Web Server on Raspberry Pi.
Install the apache2 package by typing the following command into the terminal and pressing Enter:
sudo apt-get install apache2
Install the PHP and Apache packages with the following command:
sudo apt-get install php
To test PHP, go to default web page.
Create PHP file named index.php and write your PHP script.
sudo leafpad index.php
Example for PHP script:
- <span style=”color: #000000″><?php
- echo “Hello World!</br>”;
- echo date(‘Y-m-d H:i:s’);
Delete index.html on default web page
sudo rm index.html
Install the MySQL Server and PHP-MySQL packages by entering the following command into the terminal window:
sudo apt-get install mysql-server php-mysql
sudo service apache2 restart
You can consider to buy the product from the list below.
Thanks for reading this tutorial. If you have any technical inquiry, please post at Cytron Technical Forum.