Install phpMyAdmin from source
Overview
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
wget https://files.phpmyadmin.net/phpMyAdmin/4.6.5.2/phpMyAdmin-4.6.5.2-english.tar.gz
tar xzf phpMyAdmin-4.6.5.2-english.tar.gz
mv phpMyAdmin-4.6.5.2-english phpmyadmin
chmod -R 0755 phpmyadmin
Installation
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 (https://www.phpmyadmin.net/):
wget https://files.phpmyadmin.net/phpMyAdmin/4.6.5.2/phpMyAdmin-4.6.5.2-english.tar.gz
and extract the files from the archive:
tar xzf phpMyAdmin-4.6.5.2-english.tar.gz
rename the folder:
mv phpMyAdmin-4.6.5.2-english 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
</Directory>
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”.