A tutorial for installing phpMyAdmin under Linux centos7

  • 2021-07-18 09:44:06
  • OfStack

yum install httpd php mariadb-server �y

Record 1 problems encountered in installing phpMyAdmin after setting up lamp running environment

1. Download the phpMyAdmin compressed package in official website

wget -c https://files.phpmyadmin.net/phpMyAdmin/4.9.3/phpMyAdmin-4.9.3-all-languages.tar.gz

2. Extract to/var/www/html/

tar -zxvf phpMyAdmin-4.9.3-all-languages.tar.gz -C /var/www/html/

Step 3 Rename


cd /var/www/html/
mv phpMyAdmin-4.9.3-all-languages phpMyAdmin

This 1 step 1 can be normally accessed through localhost/phpMyAdmin, but sometimes there will always be some other problems.

4. Enter the phpMyAdmin installation directory and copy the simple configuration file config. sample. inc. php of phpmyadmin as the default configuration file config. inc. php

Copy a file

cp config.sample.inc.php config.inc.php

Edit Configuration File

vim config.inc.php

The configuration file now requires a phrase password, find it


$cfg['blowfish_secret'] = ''; // If you add a few characters too short, you will get an error prompt. 
$cfg['Servers'][$i]['auth_type'] = 'cookie'; // Just default here 
$cfg['Servers'][$i]['host'] = 'localhost'; // You can change it to your own here ip Address or domain name, it doesn't matter if you don't change it 

5. If you get an error

Variable $cfg['TempDir'] (./tmp/) Unable to access. phpMyAdmin cannot cache template files, so it will run slowly.

Create a new tmp folder under the phpMyAdmin directory


mkdir tmp
chmod 777 tmp

6. You may be prompted for missing extenders

Install the extension package for php linked database

yum install php-mysql

Install packages that support multibyte string extensions

yum install php-mbstring -y

Install packages that support multiple encryption extensions

yum install php-mcrypt �y

7. Access to other computers requires opening Port 80 or closing the firewall

Open Port 80


firewall-cmd --zone=public --add-port=80/tcp --permanent
//--zone Scope, --add-port=80/tcp Add Port / Agreement, --permanent Effective permanently 

Restart the firewall

systemctl restart firewalld

Or simply shut down the firewall

View firewall status

systemctl status firewalld

Stop the firewall

tar -zxvf phpMyAdmin-4.9.3-all-languages.tar.gz -C /var/www/html/ 0

Close, open and start the firewall

systemctl disable firewalld

8. If Forbidden prompts that you do not have permission to access, it may be blocked by selinux

See if SELinux is running

gettenforce

If it is

enforcing//Force mode, restricts domain/type permissive//Tolerance mode, warns but does not restrict domain/type disabled//Off state, does not run

settenforce 0//Switching to tolerant mode is equivalent to temporarily turning off SELinuxx settenforce 1//Switching to forced mode

Set SELINUX=disables to set whether to start or not

vim /etc/selinux/config

Summarize


Related articles: