WordPress安装配置

1. wp简体中文版:

https://cn.wordpress.org/switching/

2. 下载后解压并放到服务器上

Apache

Nginx

3. 重命名 wp-config-sample.php 文件为 wp-config.php,修改配置

// ** MySQL 设置 - 具体信息来自您正在使用的主机 ** //
/** WordPress数据库的名称 */
define('DB_NAME', 'wordpress');

/** MySQL数据库用户名 */
define('DB_USER', 'kuro');

/** MySQL数据库密码 */
define('DB_PASSWORD', '密码');

/** MySQL主机 */
define('DB_HOST', '主机地址');

/** 创建数据表时默认的文字编码 */
define('DB_CHARSET', 'utf8');

/** 数据库整理类型。如不确定请勿更改 */
define('DB_COLLATE', '');

 * 或者直接访问{@link https://api.wordpress.org/secret-key/1.1/salt/ WordPress.org密钥生成服务}
 * 任何修改都会导致所有cookies失效,所有用户将必须重新登录。
 *
 * @since 2.6.0
 */
define('AUTH_KEY',         'put your unique phrase here');
define('SECURE_AUTH_KEY',  'put your unique phrase here');
define('LOGGED_IN_KEY',    'put your unique phrase here');
define('NONCE_KEY',        'put your unique phrase here');
define('AUTH_SALT',        'put your unique phrase here');
define('SECURE_AUTH_SALT', 'put your unique phrase here');
define('LOGGED_IN_SALT',   'put your unique phrase here');
define('NONCE_SALT',       'put your unique phrase here');

/**#@-*/

/**
 * WordPress数据表前缀。
 *
 * 如果您有在同一数据库内安装多个WordPress的需求,请为每个WordPress设置
 * 不同的数据表前缀。前缀名只能为数字、字母加下划线。
 */
$table_prefix  = 'wp_';

/**
 * 开发者专用:WordPress调试模式。
 *
 * 将这个值改为true,WordPress将显示所有用于开发的提示。
 * 强烈建议插件开发者在开发环境中启用WP_DEBUG。
 *
 * 要获取其他能用于调试的信息,请访问Codex。
 *
 * @link https://codex.wordpress.org/Debugging_in_WordPress
 */
define('WP_DEBUG', false);

/**
 * zh_CN本地化设置:启用ICP备案号显示
 *
 * 可在设置→常规中修改。
 * 如需禁用,请移除或注释掉本行。
 */
define('WP_ZH_CN_ICP_NUM', true);

/* 好了!请不要再继续编辑。请保存本文件。使用愉快! */

/** WordPress目录的绝对路径。 */
if ( !defined('ABSPATH') )
        define('ABSPATH', dirname(__FILE__) . '/');


/** 设置WordPress变量和包含文件。 */
require_once(ABSPATH . 'wp-settings.php');

if(is_admin()) {
        add_filter('filesystem_method', create_function('$a','return "direct";' ));
        define('FS_CHMOD_DIR', 0751);
}

4. nginx安装

1)在开始安装 Nginx 和 php7-fpm 之前,由于nginx不能直接从CentOS获得,需添加 EPEL 包的仓库源。使用命令:

yum -y install epel-release  

2)安装完EPEL 源之后,通过仓库源安装nginx: 

yum -y install nginx

3)查看nginx版本,并启动

nginx -v
systemctl start nginx

4)设置开机启动

systemctl enable nginx

5)浏览器内访问服务器的公网地址,若出现welcome to nginx,说明启动成功

5. php安装、nginx、php配置

跳转http://www.jdlhm.com/?p=556

原文地址:https://www.cnblogs.com/p36606jp/p/15113892.html