In this tutorial, we will show you how to install phpMyAdmin on AlmaLinux 8. For those of you who didn’t know, PhpMyAdmin is a PHP web application that lets us manage a MariaDB/MySQL database from an intuitive graphical interface. It provides a user-friendly web interface to access and manage your databases. To ease usage to a wide range of people, phpMyAdmin is being translated into 72 languages and supports both LTR and RTL languages.
This article assumes you have at least basic knowledge of Linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘sudo
‘ to the commands to get root privileges. I will show you the step-by-step installation of the phpMyAdmin on an AlmaLinux 8. You can follow the same instructions for Rocky Linux.
Prerequisites
- A server running one of the following operating systems: AlmaLinux 8 or Rocky Linux 8.
- It’s recommended that you use a fresh OS install to prevent any potential issues.
- SSH access to the server (or just open Terminal if you’re on a desktop).
- A
non-root sudo user
or access to theroot user
. We recommend acting as anon-root sudo user
, however, you can harm your system if you’re not careful when acting as the root.
Install phpMyAdmin on AlmaLinux 8
Step 1. First, let’s start by ensuring your system is up-to-date.
sudo dnf update
Step 2. Enable the EPEL and REMI repository,
Now we run the following command to added EPEL and Remi repository to your system:
sudo dnf install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm sudo dnf install https://rpms.remirepo.net/enterprise/remi-release-8.rpm
Step 3. Installing the PHP-Fedora-Autoloader.
One of the requirements for installing phpMyAdmin is installing the PHP-fedora-autoloader package. Now we install it using the following command below:
sudo dnf install http://rpms.remirepo.net/enterprise/8/remi/x86_64/php-fedora-autoloader-1.0.0-5.el8.remi.noarch.rpm
Step 4. Installing LAMP Stack.
If you don’t have a LAMP stack already installed on your server, you can follow our guide here.
Step 5. Installing phpMyAdmin on AlmaLinux 8.
Now we run the following command to install PHPMyAdmin:
sudo dnf --enablerepo=remi install phpMyAdmin
Step 6. Configure phpMyAdmin.
Now configure phpMyAdmin using the following command below:
nano /etc/httpd/conf.d/phpMyAdmin.conf
And replace the following line:
<Directory /usr/share/phpMyAdmin/> AddDefaultCharset UTF-8 <IfModule mod_authz_core.c> # Apache 2.4 <RequireAny> #Require ip 127.0.0.1 #Require ip ::1 Require all granted </RequireAny> </IfModule> <IfModule !mod_authz_core.c> # Apache 2.2 Order Deny,Allow Deny from All Allow from 127.0.0.1 Allow from ::1 </IfModule> </Directory>
Save your file and restart your Apache service:
sudo systemctl restart httpd
Step 7. Configure Firewall.
Create a firewall rule to allow HTTP requests from external networks:
sudo firewall-cmd --permanent --add-service=http sudo firewall-cmd --reload
Step 8. Accessing phpMyAdmin on Almalinux.
Now open your browser and surf to http://your-ip-address/phpmyadmin
. You should now be able to access phpMyAdmin using a root MySQL password, or any other MySQL user/password.
Congratulations! You have successfully installed phpMyAdmin. Thanks for using this tutorial for installing the phpMyAdmin on your AlmaLinux 8 system. For additional help or useful information, we recommend you check the official phpMyAdmin website.