20. AZURE – Linux Ubuntu how to install phpmyadmin

How easy to install and configure PhpMyAdmin on linux machine – here is on Azure Ubuntu virtual machine

sudo apt-get update
sudo apt-get install phpmyadmin

This will ask you a few questions in order to configure your installation correctly.

Warning
When the first prompt appears, apache2 is highlighted, but not selected. If you do not hit “SPACE” to select Apache, the installer will not move the necessary files during installation. Hit “SPACE”, “TAB”, and then “ENTER” to select Apache.

For the server selection, choose apache2.
Select yes when asked whether to use dbconfig-common to set up the database
You will be prompted for your database administrator’s password
You will then be asked to choose and confirm a password for the phpMyAdmin application itself

The installation process actually adds the phpMyAdmin Apache configuration file into the /etc/apache2/conf-enabled/ directory, where it is automatically read.

The only thing we need to do is explicitly enable the php5-mcrypt extension, which we can do by typing:

sudo php5enmod mcrypt

Afterwards, you’ll need to restart Apache for your changes to be recognized:

sudo service apache2 restart

You can now access the web interface by visiting your server’s domain name or public IP address followed by /phpmyadmin:

http://domain_name_or_IP/phpmyadmin

!!! The rest is Optional !!!

We will edit the linked file that has been placed in our Apache configuration directory:

sudo nano /etc/apache2/conf-available/phpmyadmin.conf

We need to add an AllowOverride All directive within the <Directory /usr/share/phpmyadmin> section of the configuration file, like this:

<Directory /usr/share/phpmyadmin>
Options FollowSymLinks
DirectoryIndex index.php
AllowOverride All
. . .

When you have added this line, save and close the file.

To implement the changes you made, restart Apache:

sudo service apache2 restart