Install phpMyAdmin in CentOS 7

The web interface of phpMyAdmin is now actively used by users of MySQL databases, because they interact only via the terminal. Installing additional software with a graphical interface will significantly simplify working with web servers, but it will first have to perform a range of activities, which sometimes cause difficulties. Today we would like as much detail as possible to consider the installation of phpMyAdmin in CentOS operating system 7, dividing all the important action steps. You only need to follow the instructions and correctly enter each command.

Install phpMyAdmin in CentOS 7

Unfortunately, the official repository of the application in question does not exist, so you have to first add the user store from which further and runs the installation process. In addition, at the moment, especially popular are the two versions of phpMyAdmin, we will tell you about installing each of them about the further configuration of the Apache web server or Nginx.

Adding phpMyAdmin

Of course, when working with a new application in Linux is always a priority is adding their libraries to the system, and phpMyAdmin is no exception. Let’s talk for a moment about the two available versions, starting with the recommended developers.

Install phpMyAdmin 4.4

4.4 phpMyAdmin works on PHP version 5.4, and as we know, this version is not the latest, that does not prevent her to be the most popular and in demand. Installation on CentOS is via the classic “Terminal” literally in a few steps:

  • Start the console by any convenient method, for example, via the menu “Applications”.
  • Enter the command sudo rpm-iUvh http://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm to download the software package from the user repository Extra Packages for Enterprise Linux.
  • To continue, enter the password of the account with root access.
  • After adding the packages you need to update the list of system libraries with the command sudo yum-y update.
  • The above command installs all available updates, and then will only have to install the client application using sudo yum-y install phpmyadmin.
  • If you are using a web server such as Apache, you will only have to restart it and check the operation of installed components by clicking on the address http://ip_вашего_сервера/phpmyadmin.

    Install the latest version of phpMyAdmin

    Some users are only interested in the latest version of phpMyAdmin to be installed where you will need to complete a few other actions that further downloading the new packages. In General, the instruction remains similar, but with some changes.

  • Add a new package to the system by downloading it from the repository using sudo rpm-Uvh http://rpms.remirepo.net/enterprise/remi-release-7.rpm.
  • Update any of the available system library using the already familiar command sudo yum update.
  • Enable support for the latest version of the app at the moment is 7.1. To do this, type yum-config-manager --enable remi-php71.
  • Install sudo yum install phpmyadmin, and the PHP version will be determined automatically.
  • The addition of all components is complete, but before beginning work with the web interface you will need to configure the server. Next, we will examine the implementation of this procedure in two popular solutions Apache and Nginx.

    Configuring phpMyAdmin with Nginx

    Some users prefer to work with the Nginx web-server as that ensures high performance and throughput. If you are a supporter of this software, after installing phpMyAdmin you will have to make a number of settings to adjust performance of the whole mechanism.

    Priority please note that the web server has already been added to the operating system, if not, alternately write in the console the following command:

    sudo yum install epel-release
    sudo yum install nginx
    sudo systemctl start nginx

    After that follow this instructions:

  • Turn on the phpMyAdmin directory to the web server using the line sudo ln-s /usr/share/phpMyAdmin /var/www/html/phpmyadmin.
  • After making changes, perform a restart by typing sudo systemctl restart php-fpm.
  • Using a standard text editor, run the configuration file sudo vi /etc/nginx/nginx.conf.
  • Find the block of”http” and add the line "disable_symlinks" off;.
  • Save the changes and close the file, then restart Nginx with sudo nginx -s reload.
  • It is recommended to secure a web server by creating a random password. To do this, type openssl passwd and copy the result. Next, you will need to run the password file using sudo vi /etc/nginx/passwords and add there a new line in the format username:passwordto the result, for example, Admin:4B7fsek4L2.

    Configure phpMyAdmin in Apache

    Though the previous web server, and is better in some aspects, the Apache is still a very popular solution and is used in the software LAMP. Its installation in CentOS is done with just a few commands:

    yum install httpd-y
    systemctl start httpd.service
    systemctl enable httpd.service

    If the server is already added or you performed the above commands, you can go directly to the setting up phpMyAdmin, and this is done in the following way:

  • Set the password for administrator access using the sudo htpasswd -c /etc/httpd/passwords admin.
  • Run the configuration file for editing: vi /etc/httpd/conf.d/phpMyAdmin.conf.
  • Find the section “<Directory>” and insert this content:

    Options Indexes FollowSymLinks
    AllowOverride All
    AuthType Basic
    AuthName "Restricted Content"
    AuthUserFile /etc/httpd/passwords
    Require valid-user

  • In this article, you were acquainted not only with the process of adding phpMyAdmin to the components themselves, but also learned about the initial setup in two different web servers. During execution, each command is strongly recommended to read the notices that appear in the console: they can sometimes indicate errors that need immediate solutions.

    Source: lumpics.ru

    (Visited 44 times, 1 visits today)