Install mysql php5 and phpmyadmin on raspberry pi

Install PHP

sudo apt-get install php5-cgi

Edit php.ini file
sudo nano /etc/php5/cgi/php.ini

Scroll the bottom and add
cgi.fix_pathinfo = 1

save and exit

Enable fast CGI
sudo lighty-enable-mod fastcgi-php

Restart lighttpd
sudo /etc/init.d/lighttpd restart

Create phpinfo page
sudo nano /var/www/phpinfo.php

and add the following
<?php phpinfo();?>

Save and exit

Enter Pi ip addres into a browser followed by phpinfo.php
http://192.168.1.x/phpinfo.php

Install MySQL and PHPMYADMIN

sudo apt-get install mysql-server mysql-client phpmyadmin

mysql root password, confirm

During the installation of PHPMyAdmin you will be asked which web server is installed. Choose lighttpd.

A message will appear asking whether you want to create a dummy database. As the message states, if you know what you are going to be using the database server for or a database is already configured then you can answer no but if you are just experimenting then you can answer yes.

I recommend answering yes to this. It doesn’t do any harm.

You may also like

Leave a Reply

Your email address will not be published. Required fields are marked *