Install phpMyAdmin on Arch Linux

Install phpMyAdmin on Arch Linux

phpMyAdmin is a PHP based database administration tool. It allows database management via the GUI web interface as well as executing SQL queries manually. It is a great addition to a LAMP or LEMP server stack. Before proceeding install Apache web server, install PHP and install MySQL / MariaDB database.

 

Install phpMyAdmin

Install the packages with pacman.

sudo pacman -S phpmyadmin php-mcrypt

 

Configure PHP Extension

Open PHP configuration file.

sudo nano /etc/php/php.ini

Verify that extension=mysqli.so and extension=mcrypt.so lines are uncommented. Optionally also uncomment extension=bz2.so and extension=zip.so lines to enable compression support. PHP also needs access to /etc/webapps directory, verify that the directory is present in open_basedir option.

 

Configure Apache

Create the configuration file for Apache.

sudo nano /etc/httpd/conf/extra/phpmyadmin.conf

 

Copy the configuration options and save the file.

Alias /phpmyadmin "/usr/share/webapps/phpMyAdmin"
<Directory "/usr/share/webapps/phpMyAdmin">
  DirectoryIndex index.php
  AllowOverride All
  Options FollowSymlinks
  Require all granted
</Directory>

 

Open apache configuration file.

sudo nano /etc/httpd/conf/httpd.conf

Add the line Include conf/extra/phpmyadmin.conf to the file. This will add the configuration file options to Apache configuration.

 

Restart Apache Server for he changes to take effect.

sudo systemctl restart httpd

 

Configure phpMyAdmin

You may see The configuration file now needs a secret passphrase (blowfish_secret). error message at the bottom in which case you can add the passphrase in the configuration file.

 

Open the configuration file.

sudo nano /etc/webapps/phpmyadmin/config.inc.php

Specify the blowfish passphrase with $cfg['blowfish_secret'] variable. The passphrase is a random string of characters for example 6k$L29-2GyxmFr89HLj-vnpqjw}nO-]7]4$WL7h).

 

Use phpMyAdmin

Access the web interface in the browser on the current IP address. For example http://192.168.0.100/phpmyadmin/. Log in with the username and password created in MySQL / MariaDB setup. By default the username is root with no password.

dom