phpMyAdmin installation configuration in Linux CentOS7 system

Posted by spikeon on Tue, 19 Nov 2019 20:45:50 +0100

Today's introduction is how to configure phpMyAdmin in Linux CentOS7 system.

Catalog

  • Environmental preparation
  • Installation package
  • Basic setup
  • Sites Preview

Environmental preparation

  • linux centos7 system
  • ssh software
  • php language environment
  • mysql database

Installation package

phpMyAdmin official website download

Before installing, use xshell to connect to the remote server.

Use wget to download and install this time.

  • First, go to the download folder.

This is where you store your downloads.

cd /home/downloads
  • Second, download the phpMyAdmin package.
wget https://files.phpmyadmin.net/phpMyAdmin/4.8.5/phpMyAdmin-4.8.5-all-languages.zip
  • Finally, extract the installation package.
unzip phpMyAdmin-4.8.5-all-languages.zip

Basic setup

  • First, move the extracted installation package to the specified folder.
mv phpMyAdmin-4.8.5-all-languages /usr/share/nginx/html/myadm
cd /usr/share/nginx/html/myadm
  • Second, modify the configuration file.
cp wp-config-sample.php wp-config.php
vi wp-config.php

Here is the content of wp-config.php.

// **MySQL settings - specific information from the host you are using * *//
/** WordPress Name of the database */
define('DB_NAME', 'test');

/** MySQL Database user name */
define('DB_USER', 'phpuser');

/** MySQL Database password */
define('DB_PASSWORD', 'phpuser123.');

/** MySQL Host */
define('DB_HOST', 'localhost');
  • Finally, configure the nginx site.
vi /etc/nginx/vhost/pam.conf
server {
  listen        80;
  server_name   phpmyadmin.eg.org;
  access_log    /var/log/nginx/phpmyadmin-access.log main;
  error_log     /var/log/nginx/phpmyadmin-error.log;
  location / {
    root    /usr/share/nginx/html/myadm;
    index   index.php;
  }
  location ~ \.php$ {
    root            /usr/share/nginx/html/myadm;
    fastcgi_pass    127.0.0.1:9000;
    fastcgi_index   index.php;
    fastcgi_param   SCRIPT_FILENAME /usr/share/nginx/html/myadm/$fastcgi_script_name;
    include         fastcgi_params;
  }
  location ~ /\.ht {
    deny all;
  }
}

Sites Preview

Add a dns record to the local hosts file.

192.168.1.101  phpmyadmin.eg.org;

Next, enter phpmyadmin.eg.org in the browser to access it.

Written in the end

This is the most basic preparation. Next time, I will introduce how to build a personal blog site, such as wordpress.

Topics: Linux phpMyAdmin Nginx PHP MySQL