Facebook Twitter Instagram
    TecAdmin
    • Home
    • Ubuntu 20.04
      • Upgrade Ubuntu
      • Install Java
      • Install Node.js
      • Install Docker
      • Install LAMP Stack
    • Tutorials
      • AWS
      • Shell Scripting
      • Docker
      • Git
      • MongoDB
    • FeedBack
    • Submit Article
    • About Us
    Facebook Twitter Instagram
    TecAdmin
    Home»Databases»MySQL»How To Install phpMyAdmin with Apache on CentOS 8

    How To Install phpMyAdmin with Apache on CentOS 8

    RahulBy RahulFebruary 23, 20202 Mins ReadUpdated:May 21, 2020

    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.

    Apache
    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 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.

    phpmyadmin on centos 8

    Conclusion

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

    MySQL Web Interface phpmyadmin PMA
    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email WhatsApp
    Previous ArticleHow to Open Port 80 & 443 in FirewallD
    Next Article How to Allow HTTP and HTTPS Services in FirewallD

    Related Posts

    How To Install Linux, Nginx, MySQL, & PHP (LEMP Stack) on Ubuntu 22.04

    Updated:April 7, 20227 Mins Read

    How To Install MySQL Server on Ubuntu 22.04

    Updated:April 6, 20224 Mins Read

    How to Rename MySQL Database

    Updated:July 26, 20213 Mins Read

    How To Change MySQL User Password

    2 Mins Read

    How to Delete A MySQL User Account

    2 Mins Read

    How to Install MySQL 8.0 on Ubuntu 20.04

    Updated:February 2, 20215 Mins Read

    8 Comments

    1. jafar on May 24, 2021 7:59 am

      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)”.

      Reply
      • Rahul on May 25, 2021 3:55 am

        Use mysql user password to logn.

        Reply
    2. Leo on March 2, 2021 1:09 pm

      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

      Reply
    3. Koray on December 26, 2020 10:37 pm

      I followed the instructions and phpmyadmin installed without problem. Thank you for sharing.

      Reply
    4. Mohamed ROMDANE on July 24, 2020 7:04 pm

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

      Nonetheless it worked 🙂

      Reply
    5. deanzg on July 15, 2020 1:43 pm

      followed tutorial step by step and end up with HTTP ERROR 500

      Reply
    6. Denilson on May 12, 2020 1:21 am

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

      Reply
    7. sunilk on May 2, 2020 12:51 pm

      not installing phpmyadmin in centos 8 (64 bit) server, I tried as above commanns

      Reply

    Leave A Reply Cancel Reply

    Recent Posts
    • How to Install Sublime Text 4 on Ubuntu 22.04
    • How to Enable / disable Firewall in Windows
    • How to Install JAVA on Ubuntu 22.04
    • Switching Display Manager in Ubuntu – GDM, LightDM & SDDM
    • Changing the Login Screen Background in Ubuntu 22.04 & 20.04
    Facebook Twitter Instagram Pinterest
    © 2022 Tecadmin.net. All Rights Reserved | Terms  | Privacy Policy

    Type above and press Enter to search. Press Esc to cancel.