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.
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.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | 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 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
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.
8 Comments
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)”.
Use mysql user password to logn.
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
I followed the instructions and phpmyadmin installed without problem. Thank you for sharing.
be aware to the folder phpmyadmin and phpMyAdmin I had to replace all the commands because linux is case sensitive.
Nonetheless it worked 🙂
followed tutorial step by step and end up with HTTP ERROR 500
this site is the best tutorial site centos 8, all very easy to explain .. and functional without errors, congratulations to the author.
not installing phpmyadmin in centos 8 (64 bit) server, I tried as above commanns