ubuntu重新安装workpress

2024-02-27 09:18 ubuntu重新安装workpress已关闭评论

需求

阿里云环境更新新版本wordpress后,发现主题不兼容,想要将wordpress 6.4.3调整为wordpress 5.2.3

环境:
1. 阿里云ECS ubuntu_16_0402_64
2. nginx+php7.0+mysql

下载wordpress

下载需要的wordpress版本,然后解压出wordpress目录,将该目录上传为ubuntu网站目录var/www/wordpress

nginx配置

找到/etc/nginx/目录

打开sites-enabled/default文件找到

# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000

然后将下方的注释去掉,开启php代码解析

location ~ \.php$ {
    include snippets/fastcgi-php.conf;

    # With php7.0-cgi alone:
#   fastcgi_pass 127.0.0.1:9000;
#   # With php7.0-fpm:
    fastcgi_pass unix:/run/php/php7.0-fpm.sock;
}

然后找到

# You can move that to a different file under sites-available/ and symlink that
# to sites-enabled/ to enable it.

将下方注释去掉,然后配置站点信息

server {
    listen 80;
    listen [::]:80;

    server_name teachcourse.cn;

    root /var/www/wordpress;
    index index.html index.php;

    location / {
        try_files $uri $uri/ =404;
    }

浏览器服务

浏览器输入localhost/wordpress,提示安装界面

按照提示,输入:Database NameUsernamePasswordDatabase HostTable Prefix

自动生成wp-config.php

上一步作用是生成wp-config.php文件,也可以直接复制已有的文件到wordpress站点根目录下

WordPress

Unable to write to wp-config.php file.

You can create the wp-config.php file manually and paste the following text into it.

Configuration rules for wp-config.php:

<?php
/**
 * The base configuration for WordPress
 *
 * The wp-config.php creation script uses this file during the installation.
 * You don't have to use the web site, you can copy this file to "wp-config.php"
 * and fill in the values.
 *
 * This file contains the following configurations:
 *
 * * Database settings
 * * Secret keys
 * * Database table prefix
 * * ABSPATH
 *
 * @link https://wordpress.org/documentation/article/editing-wp-config-php/
 *
 * @package WordPress
 */

// ** Database settings - You can get this info from your web host ** //
/** The name of the database for WordPress */
define( 'DB_NAME', 'wordpress' );

/** Database username */
define( 'DB_USER', 'root' );

/** Database password */
define( 'DB_PASSWORD', 'root' );

/** Database hostname */
define( 'DB_HOST', 'localhost' );

/** Database charset to use in creating database tables. */
define( 'DB_CHARSET', 'utf8mb4' );

/** The database collate type. Don't change this if in doubt. */
define( 'DB_COLLATE', '' );

/**#@+
 * Authentication unique keys and salts.
 *
 * Change these to different unique phrases! You can generate these using
 * the {@link https://api.wordpress.org/secret-key/1.1/salt/ WordPress.org secret-key service}.
 *
 * You can change these at any point in time to invalidate all existing cookies.
 * This will force all users to have to log in again.
 *
 * @since 2.6.0
 */
define( 'AUTH_KEY',         'SEipPR_da9%Fr>B[goT20vv+nu},S$l[M%v9Hqa7g?@J6(N<Hw.e9v)MHG1ey4-e' );
define( 'SECURE_AUTH_KEY',  '2t1*J9.%7!o`HY=b_C=#s,TP DQ3d3$pZ[}%;@vyhg.#q2i(4>Oj2G@D574!K$`M' );
define( 'LOGGED_IN_KEY',    'bqd_!1#@:;vO.[C:&^@$pJTf}WBokEaFGx6wVIp_/U%,Nb_L{uT=ZZZ@nQBe/h.O' );
define( 'NONCE_KEY',        'tq33PYyQT%[[H53<:]r&|ImkL`zEqLA`%G#,b{r2D4X_=;;F^:jU?FP3hBL08I^:' );
define( 'AUTH_SALT',        'Pc||P*-D`7aW<&j0ysAE-YqSySjZL#$n#tT4vws_Qre&v=m6e8hAsiUZxZ+QR3#$' );
define( 'SECURE_AUTH_SALT', 'D+VnNh$[/QIhL_#Wt,qR=)bhkK?_uqKdIHMrDFf62b?@iYC22~b+>*a#<&vEkl(Y' );
define( 'LOGGED_IN_SALT',   'nGm=y0_}8il #INp.$RD <AfWOGm(mP:/u#gg<[Egrof{ap|jl#sP3DrO8R=IuA.' );
define( 'NONCE_SALT',       'b]GxC|%>3;Pax7wE0A^,T$|[aIbB6/fZ%/=z|d6`;_2xy3F=:{D<OqdisJ=D@5HH' );

/**#@-*/

/**
 * WordPress database table prefix.
 *
 * You can have multiple installations in one database if you give each
 * a unique prefix. Only numbers, letters, and underscores please!
 */
$table_prefix = 'wp_';

/**
 * For developers: WordPress debugging mode.
 *
 * Change this to true to enable the display of notices during development.
 * It is strongly recommended that plugin and theme developers use WP_DEBUG
 * in their development environments.
 *
 * For information on other constants that can be used for debugging,
 * visit the documentation.
 *
 * @link https://wordpress.org/documentation/article/debugging-in-wordpress/
 */
define( 'WP_DEBUG', false );

/* Add any custom values between this line and the "stop editing" line. */



/* That's all, stop editing! Happy publishing. */

/** Absolute path to the WordPress directory. */
if ( ! defined( 'ABSPATH' ) ) {
    define( 'ABSPATH', __DIR__ . '/' );
}

/** Sets up WordPress vars and included files. */
require_once ABSPATH . 'wp-settings.php';

After you’ve done that, click “Run the installation”.

Run the installation


https://cn.wordpress.org/download/releases/

当前文章价值1.55元,扫一扫支付后添加微信提供帮助!(如不能解决您的问题,可以申请退款)

你可能感兴趣的文章

来源:每日教程每日一例,深入学习实用技术教程,关注公众号TeachCourse
转载请注明出处: https://www.teachcourse.cn/3065.html ,谢谢支持!

资源分享

分类:ubuntu 标签:,
关于90后结不起婚的原因 关于90后结不起婚的原因
浅谈短信服务SMS 浅谈短信服务SMS
Eclipse卸载已安装的Genymotion插件 Eclipse卸载已安装的Genymotio
windows系统自动化批处理命令 windows系统自动化批处理命令

评论已关闭!