The current phpMyAdmin version is compatible with PHP 7.1 and newer and MySQL 5.5 and newer. This tutorial will help you with the installation and configuration of phpMyAdmin on the CentOS 8 Linux system.

Advertisement

Step 1 – Prerequisites

We are assuming you already have installed the MySQL server on CentOS 8 operating system. So just install the other required packages to run and access phpMyAdmin.

sudo dnf install httpd wget unzip
sudo dnf install php php-pdo php-pecl-zip php-json php-mbstring php-mysqlnd

Once the installation finished, enable and start httpd web server.

sudo systemctl enable httpd.service
sudo systemctl start httpd.service

Step 2 – Install phpMyAdmin

Your system is ready for the phpMyAdmin installation. Download the latest phpMyAdmin archive from the official download page, or use the below commands to download phpMyAdmin 5.0.1 on your system.

After downloading extract archive and move to the proper location.

wget https://files.phpmyadmin.net/phpMyAdmin/5.0.1/phpMyAdmin-5.0.1-all-languages.zip
unzip phpMyAdmin-5.0.1-all-languages.zip
mv phpMyAdmin-5.0.1-all-languages /usr/share/phpmyadmin

Then create tmp directory and set the proper permissions.

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

Step 3 – Configure phpMyAdmin

Now, you need to configure web server to serve phpMyAdmin on network. Create Apache configuration file for phpMyAdmin and edit in text editor:

vi /etc/httpd/conf.d/phpmyadmin.conf

add the below content to file.

Save your file and close it. The systems with SELinux enabled needs to set proper permissions to allow SELinux policies

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

After making all the changes, make sure to start the Apache service to reload all settings.

systemctl restart httpd.service

Step 4 – Adjust Firewall

The systems with enabled firewalls need to allow HTTP service from the firewall. Run the below commands to open a port for the webserver in the firewall.

sudo firewall-cmd --permanent --add-service=http
sudo firewall-cmd --reload

Step 5 – Access phpMyAdmin

All done. You have finished the setup with the phpMyAdmin on CentOS 8 Linux machine. Now access phpMyAdmin with the below IP.

http://your-server-ip/phpmyadmin

Replace your-server-ip with the localhost (for the local machine) for server IP address.

centos 8 phpmyadmin

Log in with the username and password used to access MySQL on the command line.

Conclusion

You have successfully configured phpMyAdmin on CentOS 8 system. Let’s disable root user login for the phpMyAdmin for security purposes.

Share.

8 Comments

  1. what is the password to login? I tried with empty password, its not working, getting this error

    “Login without a password is forbidden by configuration (see AllowNoPassword)”.

  2. I followed this instructions and had only one problem, got this on the browser:
    “Composer detected issues in your platform: Your Composer dependencies require the following PHP extensions to be installed: xml”

    Solved it with this:

    # dnf install php-xml

    # systemctl restart httpd.service

  3. Mohamed ROMDANE on

    be aware to the folder phpmyadmin and phpMyAdmin I had to replace all the commands because linux is case sensitive.

    Nonetheless it worked 🙂

  4. this site is the best tutorial site centos 8, all very easy to explain .. and functional without errors, congratulations to the author.

Leave A Reply


Exit mobile version