PhpMyAdmin

We suggest installing PhpMyAdmin from the source.

Creating the paths

Create the necessary directories:

mkdir -p /var/www/pma/{logs,upload,save}"

Downloading the source code

Note

Before downloading, look up the latest stable version on phpmyadmin.net.

Then go to the archive location on the developer's site and get it:

cd /var/www/pma

wget https://files.phpmyadmin.net/phpMyAdmin/4.7.5/phpMyAdmin-4.7.5-all-languages.zip

Install a zip unpacker if you do not have it yet:

emerge -a unzip

Now extract the files:

unzip /var/www/pma/phpMyAdmin-4.7.5-all-languages.zip -d /var/www/pma

Rename the phpMyAdmin-4.7.5-all-languages directory to htdocs:

mv /var/www/pma/phpMyAdmin-4.7.5-all-languages /var/www/pma/htdocs

Configure the access rights for the pma directories as well as for all nested files and directories:

chown -R nginx:nginx /var/www/pma

PhpMyAdmin configuration file, handled by Nginx:

PhpMyAdmin uses http and its domain name is pmalempcss.calculate.loc. Create the configuration file /etc/nginx/conf.d/pma.conf and edit it as shown below:

etc/nginx/conf.d/pma.conf

nginx
# pmalempcss.calculate.loc
server {
    listen 80;
    server_name pmalempcss.calculate.local;
    access_log /var/www/pma/logs/pma.access_log main;
    error_log /var/www/pma/logs/pma.error_log info;
    root /var/www/pma/htdocs/;
    index index.php index.html index.htm;
    location ~ \.php$ {
           try_files $uri =404;
           include /etc/nginx/fastcgi.conf;
           fastcgi_pass unix:/run/php-fpm.socket;
       }
}

After the Nginx configuration file has been created, check it and restart the service:

nginx -t

/etc/init.d/nginx reload

Add the necessary data to the DNS server of the local network or edit /etc/hosts on the local computer that will be used for the connection:

/etc/hosts

192.168.0.10 pmalempcss.calculate.local

Creating a phpmyadmin configuration file

If you type http://pmalempcss.calculate.loc/setup, a page with options will open and the PhpMyAdmin configuration file will be saved.

Important

When config.inc.php has been added to the site root directory, access to it will be closed.

Here is a sample configuration file.

/var/www/pma/htdocs/config.inc.php

<?php
/*
 * Generated configuration file
 * Generated by: phpMyAdmin 4.7.5 setup script
 * Date: Sat, 18 Nov 2017 15:51:14 +0000
 */
/* Servers configuration */
$i = 0;
/* Server: localhost [1] */
$i++;
$cfg['Servers'][$i]['verbose'] = '';
$cfg['Servers'][$i]['host'] = 'localhost';
$cfg['Servers'][$i]['port'] = '';
$cfg['Servers'][$i]['socket'] = '';
$cfg['Servers'][$i]['auth_type'] = 'cookie';
$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = '';
/* End of servers configuration */
$cfg['DefaultLang'] = 'ru';
$cfg['blowfish_secret'] = '5"+y&lt;2TqP+qrobW`%c!!9"BRYdIVZGIL';
$cfg['ServerDefault'] = 1;
$cfg['UploadDir'] = '/var/www/pma/upload';
$cfg['SaveDir'] = '/var/www/pma/save';
?&gt;

Configure the access rights for the configuration file:

chown nginx:nginx /var/www/pma/htdocs/config.inc.php

To work with databases, enter http://pmalempcss.calculate.loc in your Web browser and then specify the root login and the password you created at the initial setup of MariaDB. You will get to the main PhpMyAdmin page, from where you have full control of the databases.