If you’re looking to manage your databases efficiently and securely, phpMyAdmin is the perfect tool for you. In this comprehensive guide, we’ll walk you through the step-by-step process of installing phpMyAdmin on AlmaLinux 9. Whether you’re using a KVM, OpenVZ, or Dedicated Server, this guide is applicable to all AlmaLinux 9 systems.
Prerequisites
Before we dive into the installation process, let’s ensure that we have all the necessary prerequisites in place. phpMyAdmin requires a standalone database or as part of the LAMP stack, which should already be installed and running on your system. If you haven’t set up the LAMP stack yet, refer to the “LAMP Stack on AlmaLinux 9” guide for detailed instructions.
Enabling the EPEL and REMI Repository
To proceed with the installation, we need to enable the EPEL and REMI repositories. These repositories provide the necessary packages for phpMyAdmin. Open your terminal and run the following commands:
dnf install https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm dnf install https://rpms.remirepo.net/enterprise/remi-release-9.rpm
Installing the php-fedora-autoloader
Next, we need to install the php-fedora-autoloader
package. This package is essential for the proper functioning of phpMyAdmin. Run the following command in your terminal:
dnf install https://rpms.remirepo.net/enterprise/9/remi/x86_64/php-fedora-autoloader-1.0.1-2.el9.remi.noarch.rpm
Installing phpMyAdmin
Now that we have the necessary repositories and packages installed, it’s time to install phpMyAdmin itself. Run the following command in your terminal:
dnf --enablerepo=remi install phpMyAdmin
Once the installation is complete, phpMyAdmin inserts its configuration into the Apache webserver (httpd). To load this new configuration, we need to restart httpd. Execute the following command:
service httpd restart
Configuring phpMyAdmin
Now that phpMyAdmin is installed, we need to make a few configuration changes to ensure its proper functioning. Open the phpMyAdmin.conf
file using your preferred text editor:
nano /etc/httpd/conf.d/phpMyAdmin.conf
In the file, locate the following lines at the top:
<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>
Replace these lines with the following code, which ensures proper access control:
<Directory /usr/share/phpMyAdmin/>
AddDefaultCharset UTF-8
Require all granted
</Directory>
Save the changes and exit the text editor.
Creating a Soft Link for phpMyAdmin
To conveniently access phpMyAdmin, let’s create a soft link from the default directory to the standard /var/www/html/
directory. Run the following command in your terminal:
ln -s /usr/share/phpMyAdmin/ /var/www/html/phpmyadmin
Accessing phpMyAdmin
Congratulations! You have successfully installed and configured phpMyAdmin on your AlmaLinux 9 system. To access phpMyAdmin, open your web browser and enter the following URL, replacing ip-address
with the actual IP address of your server:
http://ip-address/phpmyadmin/
You will now be presented with the phpMyAdmin login screen. Enter your database username and password to access the powerful database management interface.
At Shape.host, we understand the importance of efficient and secure database management. That’s why we offer reliable Cloud VPS solutions that empower businesses like yours. With our scalable and secure hosting services, you can focus on what matters most – growing your business. Experience the difference with Shape.host today!