您现在的位置是:首页 > 日记日记

centos安装wordpress

薄荷2022-06-02【日记】1人已围观

简介centos安装wordpress

安装nginx

yum install nginx

rpm -ivh http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm

yum install nginx

更改nginx配置文件添加

location ~ .php$ {

fastcgi_pass 127.0.0.1:9000;

fastcgi_index index.php;

fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;

include fastcgi_params;

}

service nginx start

nginx -v

systemctl status nginx

安装mysql

yum -y install mysql57-community-release-el7-10.noarch.rpm

yum -y install mysql-community-server

systemctl start mysqld.service

systemctl status mysqld.service

grep "password" /var/log/mysqld.log

mysql -uroot -p

ALTER USER 'root'@'localhost' IDENTIFIED BY 'new password';

SHOW VARIABLES LIKE 'validate_password%';

set global validate_password_policy=LOW;

set global validate_password_length=6;

grant all privileges on *.* to 'root'@'192.168.0.1' identified by 'password' with grant option;

CREATE DATABASE wordpress;

mysql> flush privileges;

安装php

yum -y install libxml2-devel

yum -y install sqlite-devel

wget https://www.php.net/distributions/php-7.4.22.tar.gz

tar -zvxf php-7.4.22.tar.gz

cd php-7.4.22

./configure --prefix=/home/php --enable-fpm

make && make install

cd /home/php/ #先进入安装目录

mv ./etc/php-fpm.conf.default ./etc/php-fpm.conf #重命名配置文件

mv ./etc/php-fpm.d/www.conf.default ./etc/php-fpm.d/www.conf #重命名配置文件

./sbin/php-fpm #启动

ps -aux |grep php-fpm #查看启动状态(下面成功启动)

安装和配置 WordPress

wget  https://cn.wordpress.org/wordpress-5.2.3-zh_CN.tar.gz

tar zxvf wordpress-5.2.3-zh_CN.tar.gz

修改WordPress配置文件

cd wordpress

cp wp-config-sample.php wp-config.php

vi wp-config.php

define('DB_NAME', 'wordpress');

/** MySQL database username */

define('DB_USER', 'root');

/** MySQL database password */

define('DB_PASSWORD', 'new password');

/** MySQL hostname */

define('DB_HOST', 'localhost');

/** Database Charset to use in creating database tables. */

define('DB_CHARSET', 'utf8');

/** The Database Collate type. Don't change this if in doubt. */

define('DB_COLLATE', '');

重启nginx

systemctl nginx restart;

Tags: