Following is the steps that I have used to install phpMyAdmin on localhost
Download phpMyAdmin Archive
1 2 3 4 | cd /home/sibi/www wget https://files.phpmyadmin.net/phpMyAdmin/4.8.1/phpMyAdmin-4.8.1-all-languages.zip unzip phpMyAdmin-4.8.1-all-languages.zip mv phpMyAdmin-4.8.1-all-languages phpmyadmin |
Then I run the commands below to set the correct permissions for phpMyAdmin to function.
1 2 | sudo chown -R www-data:www-data /home/sibi/www/phpmyadmin sudo chmod -R 755 /home/sibi/www/phpmyadmin |
When I used above command, phpmyadmin folder displayed with a lock icon
So I tried the below and it worked
1 | sudo chmod 777 -R /home/sibi/www/phpmyadmin |
Apache configuration for phpMyAdmin
Created a new Apache configuration file for phpMyAdmin
1 | touch /etc/apache2/conf-available/phpmyadmin.conf |
Open phpmyadmin.conf file in Sublime Text Editor
1 | subl /etc/apache2/conf-available/phpmyadmin.conf |
Then added the following in phpmyadmin.conf
01 02 03 04 05 06 07 08 09 10 | <Directory "/home/sibi/www/phpmyadmin"> Order Deny,Allow Deny from all Allow from localhost Allow from 127.0.0.1 Allow from 192.168.1.0 </Directory> Alias /phpmyadmin /home/sibi/www/phpmyadmin Alias /phpMyAdmin /home/sibi/www/phpmyadmin |
Restarted Apache Service
1 | sudo service apache2 restart |
But when I access http://localhost/phpmyadmin/ showing like the below screenshot
So I uninstalled php
1 | sudo apt-get remove -y --purge php7.0* |
and then reinstalled
1 2 | sudo apt-get install php -y sudo apt-get install -y php-{bcmath,bz2,intl,gd,mbstring,mcrypt,mysql,zip} && sudo apt-get install libapache2-mod-php -y |
Now I can access phpMyAdmin at http://localhost/phpmyadmin/