1.安装Apache和mariadb
yum -y install httpd
yum -y install mariadb-server mariadb
2.设置开机启动
systemctl enable httpd
systemctl enable mariadb
3.开启数据库
service mariadb start
4.数据库初始化
mysql_secure_installation
5.安装php及其必要组件
yum -y install php
yum search php
yum -y install php-mysql php-gd php-ldap php-odbc php-pear php-xml php-xmlrpc php-mbstring php-snmp php-soap curl curl-devel
6.编辑测试页
vi /var/www/html/info.php
<?php
phpinfo();
?>
7.登陆数据库
mysql -u root -pchangniansheng888
8.设置数据库账号密码
CREATE DATABASE wordpressdb;
CREATE USER wordpress@localhost IDENTIFIED BY 'changniansheng888';
9.用户授权
GRANT ALL PRIVILEGES ON wordpressdb.* TO wordpress@localhost;
FLUSH PRIVILEGES;
exit
10.wordpress必要文件移动
mv wordpress/* /var/www/html/
11.wordpress权限设置
chown -R apache:apache /var/www/html/
cd /var/www/html/
12.数据库用户密码设置
cp wp-config-sample.php wp-config.php
vi wp-config.php
来源:https://www.cnblogs.com/wangshuyi/p/6131822.html