Preface
The system is centos7.6 nginx is 1.12 php is 7.2 MySQL is 8.0.16
sudo yum install -y yum-utils
sudo yum install -y nginx
nginx
to support phpusr/share/nginx/html
If you have installed the php
service before, please uninstall it first
yum -y remove php*
Since the yum source of linux does not exist in php7.x, we have to change the yum source
rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
Install php72w and various extensions, just choose what you need
yum -y install php72w php72w-cli php72w-common php72w-devel php72w-embedded php72w-fpm php72w-gd php72w-mbstring php72w-mysqlnd php72w-opcache php72w-pdo php72w-xml
Edit php.ini
In the file (vim /etc/php.ini
) find ;cgi.fix_pathinfo=1
and change it to cgi.fix_pathinfo=0
Create nginx users and groups
groupadd -r nginx useradd -r -g nginx nginx This step is for insurance, just enter the above instructions separately, regardless of the prompt
Edit php-fmp file
vim /etc/php-fpm.d/www.conf
Change user = xxx
and group = xxx
in the figure to user = nginx, group = nginx
First go to Official Website to check the latest installation package
Download the MySQL source installation package
You can download it and upload it to the server with the xshell
tool, or you can download it directly on the server with the command wget http://dev.mysql.com/get/mysql80-community-release-el7-3.noarch.rpm
yum -y install mysql80-community-release-el7-3.noarch.rpm
Well, start the installation!
yum install mysql-community-server
Here you can go for a cup of tea, it's really long! !
Installation is complete Start MySQL service systemctl start mysqld.service
may freeze
View MySQL running status
systemctl status mysqld.service
grep "password" /var/log/mysqld.log
Use the password to log in to the account root
Sign in
mysql -uroot -p
password is obtained in the previous step
change Password
ALTER USER'root'@'localhost' IDENTIFIED BY'****************';
**** can be replaced with your password.
mysql installs the password security check plugin (validate_password) by default. The default password check policy requires that the password must contain uppercase and lowercase letters, numbers, and special symbols, and the length cannot be less than 8 characters. Otherwise, it will prompt ERROR 1819 (HY000): Your password does not satisfy the current policy requirements error
Set auto start
systemctl enable mysqld``systemctl daemon-reload
create user 'username'@'localhost' identified by 'password';
Modify the authentication method to log in to phpmyadmin
ALTER USER'username'@'localhost' IDENTIFIED WITH mysql_native_password BY'your password';
Create database
create typecho;
Give database ownership
grant all on database.* to 'username'@'localhost' ;
Recommended Posts