‍phpMyAdmin is a powerful and user-friendly web-based interface for managing MySQL and MariaDB databases. In this comprehensive guide, we will walk you through the step-by-step process of installing phpMyAdmin on a Rocky Linux 8 powered system. By following these instructions, you will be able to effortlessly set up phpMyAdmin and streamline your database management tasks. Let’s get started!

Step 1: Install Required Packages

To begin with, we need to install the necessary packages for phpMyAdmin. Open your terminal and execute the following command:

dnf install php php-pdo php-pecl-zip php-json php-mbstring php-mysqlnd

Step 2: Enable and Start the Apache Web Server

Next, we’ll enable and start the Apache web server. Use the following commands:

systemctl enable httpd.service
systemctl start httpd.service

Step 3: Download phpMyAdmin

Now, let’s download the latest version of phpMyAdmin from the official download page. You can use the wget command to do this. Here’s an example:

wget https://files.phpmyadmin.net/phpMyAdmin/5.0.1/phpMyAdmin-5.0.1-all-languages.zip

Step 4: Extract the Archive

Once the download is complete, we need to extract the phpMyAdmin archive. Use the unzip command to extract the files. Here’s an example:

unzip phpMyAdmin-5.0.1-all-languages.zip

Step 5: Move phpMyAdmin to the Correct Location

Now that we have extracted the files, let’s move the phpMyAdmin directory to the appropriate location. Execute the following command:

mv phpMyAdmin-5.0.1-all-languages /usr/share/phpmyadmin

Step 6: Create the tmp Directory and Set Permissions

To ensure that phpMyAdmin functions smoothly, we need to create a temporary directory and set the correct permissions. Use the following commands:

mkdir /usr/share/phpmyadmin/tmp
chown -R apache:apache /usr/share/phpmyadmin
chmod 777 /usr/share/phpmyadmin/tmp

Step 7: Configure phpMyAdmin

Now, let’s configure phpMyAdmin to work seamlessly with our setup. Open the phpMyAdmin.conf file in your preferred text editor. Here’s an example using nano:

nano /etc/httpd/conf.d/phpmyadmin.conf

Add the following content to the file:

Alias /phpmyadmin /usr/share/phpmyadmin

<Directory /usr/share/phpmyadmin/>
AddDefaultCharset UTF-8
<IfModule mod_authz_core.c>
# Apache 2.4
<RequireAny>
Require all granted
</RequireAny>
</IfModule>
</Directory>

<Directory /usr/share/phpmyadmin/setup/>
<IfModule mod_authz_core.c>
# Apache 2.4
<RequireAny>
Require all granted
</RequireAny>
</IfModule>
</Directory>

Save the changes and exit the text editor.

Step 8: Enable SELinux and Set Permissions

To ensure proper functioning of phpMyAdmin, we need to enable SELinux and set the correct permissions. Execute the following command:

chcon-Rv --type=httpd_sys_content_t /usr/share/phpmyadmin/*

Step 9: Restart Apache

After making these configuration changes, we need to restart the Apache service to apply the new settings. Use the following command:

systemctl restart httpd.service

Step 10: Update Firewall Rules

To allow HTTP and HTTPS requests on your web server, we need to update the firewall rules. Execute the following commands:

firewall-cmd --permanent --zone=public --add-service=http
firewall-cmd --permanent --zone=public --add-service=https
firewall-cmd --reload

Step 11: Access phpMyAdmin

At this point, phpMyAdmin is successfully installed on your Rocky Linux 8 system. To access it, open your preferred web browser and enter the following address in the browser’s address bar:

http://IP-Address/phpmyadmin/

Replace IP-Address with the actual IP address of your server. You should now see the phpMyAdmin login screen.

Congratulations! You have successfully installed phpMyAdmin on your Rocky Linux 8 system. You can now manage your MySQL and MariaDB databases with ease.

Conclusion

In this article, we have provided a detailed guide on how to install phpMyAdmin on a Rocky Linux 8 powered system. By following the step-by-step instructions, you can effortlessly set up phpMyAdmin and streamline your database management tasks. We hope this guide has been helpful to you.

If you are looking for a reliable and scalable cloud hosting solution, Shape.host offers Cloud VPS services that provide excellent performance and security. Visit Shape.host to learn more about their hosting solutions.