Install phpMyAdmin from source


   In this tutorial we will give a quick instruction on downloading and installing phpMyAdmin from the source on a general setup.

   phpMyAdmin is a popular web based MySQL management environment used by many developers. On popular distributions you can quickly install phpMyAdmin using package managers. This tutorial focuses on the installation from the source files when installing with package manager is not applicable.

   Full script


       cd /usr/share




       tar xzf phpMyAdmin-


       mv phpMyAdmin- phpmyadmin


       chmod -R 0755 phpmyadmin


   In order to install phpMyAdmin you might need administrative priviledges on your server as well as administator user for the MySQL database server.

   Our recommended location for installing phpMyAdmin is ‘/usr/share’, so we start with:


       cd /usr/share

   Download the latest version of phpMyAdmin from the official site (



   and extract the files from the archive:


       tar xzf phpMyAdmin-

   rename the folder:


       mv phpMyAdmin- phpmyadmin

   change permissions:


       chmod -R 0755 phpmyadmin

   Adding Apache2 alias

   The last step to enable access to the phpMyAdmin is to add an alias to the folder in the Apache2 configuration.

   To do it either edit the apache2.conf or add a new ‘phpmyadmin.conf’ file in the Apache2 configuration folder.

   To add an alias, you must include the following lines in your Apache2 configuration:


       Alias /phpmyadmin “/usr/share/phpmyadmin/”
       <Directory “/usr/share/phpmyadmin/”>
            Order allow,deny
            Allow from all
            Require all granted

   After changing the configuration you must restart the Apache2 service:

   RHEL / CentOS:


       service httpd restart

   Debian / Ubuntu:


       service apache2 restart


   With that your phpMyAdmin should be ready to use and accessible at your server address – “/phpmyadmin”.