Raspberry Pi LAMP installation guide

This short guide teaches you how to turn Raspberry Pi into a LAMP server.
LAMP stands for Linux Apache MySQL PHP

Step 1: update the Raspberry Pi OS to the latest version:

sudo apt-get install -y rpi-update
sudo apt-get update -y && sudo apt-get upgrade -y

Step 2: install Apache Webserver and create permissions:
sudo apt-get install -y apache2 apache2-utils
sudo groupadd -f -g33 www-data
sudo chown pi:www-data /var/www
sudo chmod 775 /var/www

Step 3: install PHP and mod_php
sudo apt-get install -y php5 libapache2-mod-php5 php5-common mysql-client
sudo apt-get install -y php-pear php5-mysql php5-curl php5-gd php5-idn php5-imagick php5-imap php5-mcrypt php5-memcache php5-mhash php5-ming php5-ps php5-pspell php5-
recode php5-snmp php5-sqlite php5-tidy php5-xmlrpc php5-xsl php5-json

Step 4: Install MySQL and phpMyAdmin

sudo apt-get install -y mysql-server
mysql_secure_installation
sudo apt-get install -y
phpmyadmin