Facebook Twitter Instagram
    TecAdmin
    • Home
    • FeedBack
    • Submit Article
    • About Us
    Facebook Twitter Instagram
    TecAdmin
    You are at:Home»Linux Tutorials»How To Install phpMyAdmin From Source In Linux

    How To Install phpMyAdmin From Source In Linux

    By RahulNovember 21, 20132 Mins ReadUpdated:September 5, 2022

    phpMyAdmin is web-based client written in PHP programming language for managing MySQL databases. It provides a user-friendly web interface to access and manage your databases. This article will help you to install phpMyAdmin on CentOS, RHEL, Fedora, Ubuntu, Debian, and other Linux operating systems. Before installing PHPMyAdmin make sure that you have Apache, PHP, and MySQL installed on the server. If you do not have them read our tutorials on how to install them.

    Advertisement
    • Setup LAMP Stack on CentOS and Redhat
    • Setup LAMP Stack on Ubuntu

    Step 1 – Download phpMyAdmin Archive

    Download the latest phpMyAdmin source code and extract it to your system using. Click here to download latest or any older release of phpMyAdmin. Also, extract the downloaded archive. The latest version of phpMyAdmin is compatible with PHP >= 7.1 and MySQL/MariaDB >= 5.5 and newer.

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

    Now set the proper permissions on files to be used with the web server. Generally, the Apache webserver runs under a user and group named www-data on Debian-based systems and apache on Redhat-based systems.

    ### Debian based system 
    chown -R www-data:www-data /usr/share/phpmyadmin 
    chmod -R 755 /usr/share/phpmyadmin 
    
    ### Redhat based system 
    chown -R apache:apache /usr/share/phpmyadmin 
    chmod -R 755 /usr/share/phpmyadmin 
    

    Step 2 – Setup Apache for phpMyAdmin

    Create a new Apache configuration file for phpMyAdmin /etc/httpd/conf.d/phpmyadmin.conf for RedHat based system and /etc/apache2/conf-available/phpmyadmin.conf for Debian based systems and add following settings there.

    <Directory "/usr/share/phpmyadmin">
      Order Deny,Allow
      Deny from all
      Allow from localhost
      Allow from 127.0.0.1
      Allow from 192.168.1.0/24
    </Directory>
    
    Alias /phpmyadmin /usr/share/phpmyadmin
    Alias /phpMyAdmin /usr/share/phpmyadmin
    

    Change 192.168.1.0/24 with your LAN subnet IP addresses.

    Step 3 – Restart Apache Service

    After creating a configuration file we need to restart or reload the Apache service. I prefer to just reload on production servers.

    sudo service httpd reload            ## RedHat based systems 
    sudo service apache2 reload          ## Debian based systems 
    

    Step 4 – Access phpMyAdmin

    Now you can access phpMyAdmin in a browser using the following URL. Change localhost with your server’s IP or hostname.

    URL: http://localhost/phpMyAdmin/
    Login Details: Use MySQL username and password.

    Install latest phpMyAdmin using Source Code

    Congratulation’s You have successfully installed phpMyAdmin.

    Adminer dbaccess MySQL MySQL Web Interface PHP phpmyadmin PMA
    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email WhatsApp

    Related Posts

    An Introduction to the “./configure” Command: Compiling Source Code in Linux

    Installing PHP on Pop!_OS

    How to Install PHP 8.x on Pop!_OS

    Managing Dependencies with Composer: A Beginner’s Guide

    View 21 Comments

    21 Comments

    1. Aneesh Sankar on December 31, 2019 6:05 pm

      My Experiments – Now Got Success

      Installing phpMyAdmin 5.0
      ———————————–
      Download phpMyAdmin Archive

      Download latest phpMyAdmin source code and extract on your system using. (https://www.phpmyadmin.net/downloads/)

      wget https://files.phpmyadmin.net/phpMyAdmin/5.0.0/phpMyAdmin-5.0.0-all-languages.zip
      unzip phpMyAdmin-5.0.0-all-languages.zip
      mv phpMyAdmin-5.0.0-all-languages phpmyadmin

      Now set the proper permissions on files to be used with the web server. Generally, Apache web server runs under user and group named www-data on Debian based systems and apache on Redhat based systems.

      ### Debian based system
      chown -R www-data:www-data /var/www/html/phpmyadmin
      chmod -R 755 /var/www/html/phpmyadmin

      ### Redhat based system
      chown -R apache:apache /var/www/html/phpmyadmin
      chmod -R 755 /var/www/html/phpmyadmin

      Setup Apache for phpMyAdmin
      —————————-
      Create a new Apache configuration file for phpMyAdmin /etc/httpd/conf.d/phpmyadmin.conf for RedHat based system and /etc/apache2/conf-available/phpmyadmin.conf for Debian based systems and add following settings there.

      AddDefaultCharset UTF-8

      # Apache 2.4

      #Require ip 127.0.0.1
      #Require ip ::1
      Require all granted

      # Apache 2.2
      Order Deny,Allow
      Deny from All
      Allow from 127.0.0.1
      Allow from ::1

      Alias /phpmyadmin /var/www/html/phpmyadmin
      Alias /phpMyAdmin /var/www/html/phpmyadmin

      Restart Apache Service
      ————————
      After creating a configuration file we need to restart or reload Apache service.

      systemctl restart httpd.service

      Setup phpMyAdmin
      —————–
      MySQL root user password update

      mysql -u root -h localhost -p

      mysql> ALTER USER ‘root’@’localhost’ IDENTIFIED WITH mysql_native_password BY ‘Sjcet123#’;

      Warnings (Fix)

      >> TempDir : This value should be double checked to ensure that this directory is neither world accessible nor readable or writable by other users on your

      Solution was to create a folder called tmp like this: /var/www/html/phpmyadmin/tmp.

      mkdir /var/www/html/phpmyadmin/tmp

      >> ZIP : Zip decompression requires function (zip_open) which are unavailable on this system.

      yum –enablerepo=remi-php73 install php-pecl-zip

      Blowfish Password
      ——————
      $cfg[‘blowfish_secret’] = ‘u=s|qeyn-?Pn]3erdN97{waRyq7[pkvY’;

      Access phpMyAdmin
      ——————
      Now you can access phpMyAdmin in a browser using the following URL.

      URL: http://localhost/phpMyAdmin/
      Login Details: Use MySQL username and password.

      Reply
    2. Aneesh Sankar on December 31, 2019 3:38 pm

      I am using Oracle Linux 7 (el)

      Installed LAMP as per your tutorial – working fine.

      Now, I followed How to Install PhpMyAdmin 4.8 on CentOS/RHEL 7/6 (https://tecadmin.net/install-phpmyadmin-on-centos/)

      Downloaded latest version of phpMyAdmin (5.0)

      After the complete steps.. while accessing http://localhost/phpmyadmin
      showing this error…. Kindly help if possible… by email to me : [email protected]

      ———————————————–
      Forbidden

      You don’t have permission to access /phpmyadmin on this server.

      ————————————————-

      Reply
    3. Steve on September 20, 2019 2:44 pm

      Worked like a dream! Cheers Rahul

      Reply
    4. Jishan Shaikh on October 31, 2018 2:32 am

      What is to replace with http://192.168.1.0/24/? Or how to change 192.168.1.0/24 with your LAN subnet IP addresses?

      Reply
    5. sibi on May 24, 2018 10:31 am

      I installed phpMyAdmin-4.8.0.1 in /home/user/www/phpmyadmin.

      config.inc.php already there. For fixing the eror i tried by editing ‘cookie’ wih http lke you told in the comment. but not fixed.

      Getting error like the screenshot

      http://imagehostnow.com/uploads/ccbc87e4b5/2717.jpg

      Reply
      • Rahul K. on May 28, 2018 4:37 am

        Hi Sibi,

        It’s showing php script on page. It means you don’t have PHP module for Apache. Try below command:

        apt install libapache2-mod-php

        Or use the module with the same version of your php like (libapache2-mod-php7.2 or libapache2-mod-php5.6) etc.

        Reply
    6. me on February 8, 2017 8:39 am

      keep having 403 , I did “acces from all” since I dont need to filter the ip , it’s a local server

      Reply
      • Rahul K. on April 18, 2018 8:31 am

        You can use “Allow from 127.0.0.1” in the configuration file. Also updated the tutorial accordingly.

        Reply
    7. Alfakom.mk on January 22, 2015 12:27 pm

      Your problems may have different solutions.
      1. If you have previosely installed another version of phpmyadmin, then even if you’ve uninstalled it, the phpmyadmin folder remained, and folowing this tutorial instead of renaming the folder into phpmyadmin, you’ve moved it in the same folder as subfolder…
      Solution:
      # cd phpmyadmin
      # ls
      Check if there is only one folder (the name of the phpmyadmin version) and if so:
      # mv phpMyAdmin-4.2.10-all-languages /usr/share/
      # rm -r phpmyadmin
      And then the rest of the process from this tutorial starting from:
      # mv phpMyAdmin-4.2.10-all-languages phpmyadmin

      2. Solution
      # cd /usr/share/phpmyadmin/
      # mv config.sample.inc.php config.inc.php
      # vi config.inc.php
      Edit this line and change the ‘cookie’ to ‘http’
      $cfg[‘Servers’][$i][‘auth_type’] = ‘cookie’;

      Save the file restart httpd and try to connect.
      I would suggest to comment the whole <directory part from phpMyAdmin.conf and generate a strong root password with
      # mysql_secure_installation
      So you can later authenticate as root user from your browser…

      My comment wont do you any good, but better late than never. And also as a solution for all the other users which will have the same problem…

      Reply
    8. Aaditya on December 1, 2014 9:39 pm

      Hi Rahul,

      Great post, and great site! It’s definitely helped me out a lot!

      I have used this guide to install phpMyAdmin on my server, but I get a blank page when loading the url… First I had the 403 Access Forbidden error just as Ivan and Isma, but I changed the conf file as suggested, and now the page is just blank. Any help would be appreciated.

      Thanks!

      Reply
    9. isma on October 14, 2014 8:02 am

      Same problem than Ivan here!

      Impossible to solve the “Forbidden”

      Reply
    10. Ivan on July 22, 2014 2:12 pm

      Hi Rahul,
      Thank you for your reply.
      Here is the file, as you can see it’s exactly as yours.

      Order Deny,Allow
      Deny from all
      Allow from all
      #Allow from 192.168.1.0/24

      Alias /phpmyadmin /usr/share/phpmyadmin
      Alias /phpMyAdmin /usr/share/phpmyadmin

      Reply
    11. Ivan on July 22, 2014 5:33 am

      Hello Rahul,
      Firstly, let me thank you for your wonderful tutorials, I’ve learned very much with your help.
      Even though in this ocassion it’s been impossible to access PhpMyAdmin, I´ve installed and reinstalled every thing from scratch over and over again, created new Instances on Amazon, etc, however the result is always the same, this frustrating message: “Forbidden
      You don’t have permission to access /phpmyadmin/ on this server.”

      I’d appreaciate very much any help you can provide to me.
      Thank you in advance,

      I’m using:
      RHEL 7, MariaDB, PHP 5.4.30, Apache 2
      (http://ec2-54-94-156-123.sa-east-1.compute.amazonaws.com/phpinfo.php)

      Reply
      • Rahul on July 22, 2014 9:05 am

        Hi Ivan,

        Post your /etc/httpd/conf.d/phpMyAdmin.conf file content.

        Reply
      • Rahul on July 22, 2014 9:07 am

        Hi Ivan,

        When you need to access phpMyAdmin from public network.. try to update phpMyAdmin.conf as below –

        Order Deny,Allow
        Deny from all
        Allow from all

        Reply
        • Ivan on July 23, 2014 2:08 am

          Hi Rahul,

          I retry several more times, followed every step, but it’s simply impossible, error 403 persists. I’ll terminate the instances on AWS and start all over again for the fourth time.

          Thanks anyways Rahul.

          Reply
          • Rahul on July 23, 2014 3:44 am

            Hi Ivan,

            If possible, provide me your server access. I can check it directly on your server. Contact me on my email.

            Reply
    12. Siddharth on June 5, 2014 11:02 am

      I have installed phpmyadmin by above method but i got below error.
      “The mysqli extension is missing. Please check your PHP configuration. See our documentation for more information.”

      Tell me how to fix

      Reply
      • Rahul on June 5, 2014 12:43 pm

        Hi Siddharth,

        Please install php-mysql extension first.

        Reply
        • Sheik Abdul kathar on March 20, 2018 8:57 am

          Hi,

          whenever I’m installing phpmyadmin I’m getting an error it’s saying depencies need to install and If I installed the same also the same issue.

          Please suggest for the same.

          [[email protected] phpmyadmin]# tar -xvf phpMyAdmin-4.7.6-all-languages.zip
          tar: This does not look like a tar archive
          tar: Skipping to next header
          tar: Exiting with failure status due to previous errors
          [[email protected] phpmyadmin]# tar xvzf phpMyAdmin-4.7.6-all-languages.zip
          gzip: stdin has more than one entry–rest ignored
          tar: Child returned status 2
          tar: Error is not recoverable: exiting now
          [[email protected] phpmyadmin]# gunzip phpMyAdmin-4.7.6-all-languages.zip
          gzip: phpMyAdmin-4.7.6-all-languages.zip: unknown suffix — ignored
          [[email protected] phpmyadmin]# tar tvf phpMyAdmin-4.7.6-all-languages.zip
          tar: This does not look like a tar archive
          tar: Skipping to next header
          tar: Exiting with failure status due to previous errors
          [[email protected] phpmyadmin]# clear
          [[email protected] phpmyadmin]#
          [[email protected] phpmyadmin]#
          [[email protected] phpmyadmin]#
          [[email protected] phpmyadmin]#
          login as: root
          [email protected]‘s password:
          Last login: Tue Mar 20 12:21:00 2018 from noc2-hcl-pc.iimb.ernet.in
          [[email protected] ~]# yum install phpmyadmin
          Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-manager
          This system is registered with an entitlement server, but is not receiving updates. You can use subscription-manager to assign subscriptions.
          Resolving Dependencies
          –> Running transaction check
          —> Package phpMyAdmin.noarch 0:4.4.15.10-2.el7 will be installed
          –> Processing Dependency: php-mbstring >= 5.3.7 for package: phpMyAdmin-4.4.15.10-2.el7.noarch
          –> Processing Dependency: php-php-gettext for package: phpMyAdmin-4.4.15.10-2.el7.noarch
          –> Processing Dependency: php-tcpdf for package: phpMyAdmin-4.4.15.10-2.el7.noarch
          –> Processing Dependency: php-tcpdf-dejavu-sans-fonts for package: phpMyAdmin-4.4.15.10-2.el7.noarch
          –> Running transaction check
          —> Package php-php-gettext.noarch 0:1.0.12-1.el7 will be installed
          –> Processing Dependency: php-mbstring for package: php-php-gettext-1.0.12-1.el7.noarch
          —> Package php-tcpdf.noarch 0:6.2.13-1.el7 will be installed
          –> Processing Dependency: php-bcmath for package: php-tcpdf-6.2.13-1.el7.noarch
          –> Processing Dependency: php-composer(fedora/autoloader) for package: php-tcpdf-6.2.13-1.el7.noarch
          –> Processing Dependency: php-mbstring for package: php-tcpdf-6.2.13-1.el7.noarch
          –> Processing Dependency: php-tidy for package: php-tcpdf-6.2.13-1.el7.noarch
          —> Package php-tcpdf-dejavu-sans-fonts.noarch 0:6.2.13-1.el7 will be installed
          —> Package phpMyAdmin.noarch 0:4.4.15.10-2.el7 will be installed
          –> Processing Dependency: php-mbstring >= 5.3.7 for package: phpMyAdmin-4.4.15.10-2.el7.noarch
          –> Running transaction check
          —> Package php-fedora-autoloader.noarch 0:1.0.0-1.el7 will be installed
          —> Package php-php-gettext.noarch 0:1.0.12-1.el7 will be installed
          –> Processing Dependency: php-mbstring for package: php-php-gettext-1.0.12-1.el7.noarch
          —> Package php-tcpdf.noarch 0:6.2.13-1.el7 will be installed
          –> Processing Dependency: php-bcmath for package: php-tcpdf-6.2.13-1.el7.noarch
          –> Processing Dependency: php-mbstring for package: php-tcpdf-6.2.13-1.el7.noarch
          —> Package php-tidy.x86_64 0:5.4.16-7.el7 will be installed
          –> Processing Dependency: libtidy-0.99.so.0()(64bit) for package: php-tidy-5.4.16-7.el7.x86_64
          —> Package phpMyAdmin.noarch 0:4.4.15.10-2.el7 will be installed
          –> Processing Dependency: php-mbstring >= 5.3.7 for package: phpMyAdmin-4.4.15.10-2.el7.noarch
          –> Running transaction check
          —> Package compat-libtidy.x86_64 0:0.99.0-37.20091203.el7 will be installed
          —> Package php-php-gettext.noarch 0:1.0.12-1.el7 will be installed
          –> Processing Dependency: php-mbstring for package: php-php-gettext-1.0.12-1.el7.noarch
          —> Package php-tcpdf.noarch 0:6.2.13-1.el7 will be installed
          –> Processing Dependency: php-bcmath for package: php-tcpdf-6.2.13-1.el7.noarch
          –> Processing Dependency: php-mbstring for package: php-tcpdf-6.2.13-1.el7.noarch
          —> Package phpMyAdmin.noarch 0:4.4.15.10-2.el7 will be installed
          –> Processing Dependency: php-mbstring >= 5.3.7 for package: phpMyAdmin-4.4.15.10-2.el7.noarch
          –> Finished Dependency Resolution
          Error: Package: php-tcpdf-6.2.13-1.el7.noarch (epel)
          Requires: php-mbstring
          Error: Package: php-php-gettext-1.0.12-1.el7.noarch (epel)
          Requires: php-mbstring
          Error: Package: phpMyAdmin-4.4.15.10-2.el7.noarch (epel)
          Requires: php-mbstring >= 5.3.7
          Error: Package: php-tcpdf-6.2.13-1.el7.noarch (epel)
          Requires: php-bcmath
          You could try using –skip-broken to work around the problem
          You could try running: rpm -Va –nofiles –nodigest

          I have tried all the packages lists.But same issue.Tried to install the seperate packages also same issue.

          Please help me to resolve the issue.

          Reply
          • Rahul K. on March 20, 2018 4:22 pm

            Use unzip command to extract archive. I have corrected command in tutorial.

            Reply

    Leave A Reply Cancel Reply

    Advertisement
    Recent Posts
    • Error: EACCES: permission denied, scandir (Resolved)
    • How To Install Python 3.11 on Ubuntu 22.04 / 20.04
    • How to Install Python 3.11 on Amazon Linux 2
    • An Introduction to the “./configure” Command: Compiling Source Code in Linux
    • How to Install PHP 8.x on Pop!_OS
    Facebook Twitter Instagram Pinterest
    © 2023 Tecadmin.net. All Rights Reserved | Terms  | Privacy Policy

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