If you’re running your mysql databases on Fedora 33, PhpMyAdmin is an essential tool that simplifies MySQL/MariaDB database management via a user-friendly web interface. In this guide, we’ll go through the process of installing PhpMyAdmin on Fedora 33.
Prerequisites
Before you start, make sure you have the following:
- A running Fedora 33 system
- Root or sudo user access
- LAMP stack installed (Apache, MariaDB/MySQL, PHP)
Step 1: Run the following command
sudo dnf install httpd mariadb-server php php-mysqli php-json -y
Enable and start Apache and MariaDB services:
sudo systemctl enable httpd mariadb
sudo systemctl start httpd mariadb
let’s install PhpMyAdmin from the Fedora repositories. Run the following command:
sudo dnf install phpmyadmin -y
Step 2: Configure Apache for PhpMyAdmin
To make PhpMyAdmin accessible via the web, we need to configure Apache.
Open the Apache configuration file for PhpMyAdmin:
sudo vim /etc/httpd/conf.d/phpMyAdmin.conf
Look for the section starting with <Directory /usr/share/phpMyAdmin/>
and modify it as follows:
<Directory /usr/share/phpMyAdmin/>
AddDefaultCharset UTF-8
<IfModule mod_authz_core.c>
Require all granted
</IfModule>
</Directory>
Save and close the file.
Restart Apache to apply the changes:
sudo systemctl restart httpd
Step 3: Secure MariaDB (Optional but Recommended)
Run the following command to set a root password and remove unnecessary users:
sudo mysql_secure_installation
Step 4: Verify PhpMyAdmin Installation
http://localhost/phpmyadmin
Step 5: Troubleshooting Common Issues
- Forbidden Access (403 Error):
If you encounter a 403 error, ensure that the firewall isn’t blocking Apache. Use the following command to allow HTTP traffic:
sudo firewall-cmd –permanent –add-service=http
sudo firewall-cmd –reload
PHP Errors:
Ensure that PHP is installed correctly and Apache can interpret PHP files. Restart both Apache and PHP:
sudo systemctl restart httpd php-fpm
Thats it. Enjoy coding.