centos7 搭建WordPress详细步骤

#安装LAMP
yum install httpd mariadb mariadb-server php php-mysql -y
#新建测试php页
echo "<? phpinfo (); ?>" > /var/www/html/phpinfo.php
#启动httpd
systemctl restart httpd
#重启防火墙,并允许http通过
systemctl restart firewalld
firewall-cmd --permanent --add-service=http

#启动数据库,并设置密码,
systemctl restart mariadb
mysql -u root -p
set password = password(‘123456‘);
创建数据库
MariaDB [(none)]> create database wordpress;
创建用户
MariaDB [(none)]> create user ‘laotang6‘@‘localhost‘ identified by ‘123456‘;
用户授权
MariaDB [(none)]> grant all on wordpress.* to ‘laotang6‘@‘localhost‘;

exit
#安装WordPress中文版
wget https://cn.wordpress.org/wordpress-4.9.4-zh_CN.tar.gz
#解压
tar xzvf wordpress-4.9.4-zh_CN.tar.gz
cd wordpress/
mv * /var/www/html/
cd /var/www/html/
chmod 777 -R wp-content/
#启动httpd
systemctl restart httpd
游览器访问:
填入我们前面创建的数据库跟数据库用户和密码。admin

出现这个情况,我们在/var/www/html/手动创建文件就可以了

vim /var/www/html/wp-config.php
将上图提示的文件内容复制进去

如上,WordPress基础已经配置完成了
接着配置FTP,让WordPress能够下载跟上传文件
yum install vsftpd -y
systemctl restart vsftpd
firewall-cmd --permanent --add-service=ftp
firewall-cmd --reload
新建用户,跟密码
useradd laotang6
passwd laotang6

媒体库默认最大文件为2M,

我们这里更改为50M:
vim /etc/php.ini
upload_max_filesize = 50M
post_max_size = 50M
systemctl restart httpd

https://blog.51cto.com/laotang6/2163983

相关文章
相关标签/搜索