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.

  • Eduard Valentin

    Hey can you help me and tell me why is this happening ? I installed everything as arch wiki says … i’ve done the shit is needed so the php works … i don’t freaking get it

    • Looks at apache logs, there might be an error. Otherwise remove everything and make sure you follow apache, php and phpmyadmin articles as I can confirm it still works for me.

  • Vishnu Iyer

    Hey, I followed all your articles related to Installing Apache,MySql-MariaDB ,PHP,PHPADMIN
    I have issue with PHPMYADMIN
    I get the following screen on visiting localhost/phpmyadmin or (mylaptopipaddress)/phpmyadmin
    Can you help me out.

  • Vishnu Iyer

    This was the page which is displayed.

  • Honestly I am not sure. Try a different browser and reinstalling. Other than that you can try to install on a different system to rule out an issue with phpmyadmin installation.

  • Sanjay Shr

    i have also same problem that @vishnuiyer:disqus has, having . i have tried on both chrome and firefox ,

    • It looks like PHP is not installed or configured properly.

      Since I can’t post PHP code in the comments I added a section on how to test PHP in the Install PHP on Arch Linux post. Try it, if PHP is not working then it’s not an issue with phpMyAdmin.