Installing LAMP (Linux+Apache+MySQL+PHP)
– Installing Apache with the following commands:
sudo apt-get update
sudo apt-get install apache2
In order to check if Apache is working, we can open a browser and load the port 80 from our Raspberry Pi (in my case http://192.168.1.20).
– Installing php with the following command:
sudo apt-get update php5 libapache2-mod-php5
We can check if PHP is working by creating the following file and accessing it through a browser (in my case http://192.168.1.20/index.php).
echo "<?php phpinfo(); ?>" > index.php
sudo mv index.php /var/www/html
– Installing MySQL with the following command:
sudo apt-get install mysql-server mysql-client php5-mysql
In order to check if MySQL is working, we’ll type the following command and we’ll login with the password that we chose in the installation process:
mysql -u root -p
now inside MySQL we can list all databases with:
show databases;
exit
– Installing phpmyadmin with the following command:
sudo apt-get install phpmyadmin
In order to check if phpmyadmin works, we’ll add the following line:
Include /etc/phpmyadmin/apache.conf
to apache2.conf, with the following command:
sudo nano /etc/apache2/apache2.conf
and we’ll restart apache2 service:
sudo /etc/init.d/apache2 restart
We can now query databases by accessing “phpmyadmin” through a browser (in my case http://192.168.1.20/phpmyadmin)
Null Games