zoukankan      html  css  js  c++  java
  • WordPress的config.php不小心删掉

    [原文件]

    <?php
    /**
     * WordPress基础配置文件。
     *
     * 这个文件被安装程序用于自动生成wp-config.php配置文件,
     * 您可以不使用网站,您需要手动复制这个文件,
     * 并重命名为“wp-config.php”,然后填入相关信息。
     *
     * 本文件包含以下配置选项:
     *
     * * MySQL设置
     * * 密钥
     * * 数据库表名前缀
     * * ABSPATH
     *
     * @link https://codex.wordpress.org/zh-cn:%E7%BC%96%E8%BE%91_wp-config.php
     *
     * @package WordPress
     */
    
    // ** MySQL 设置 - 具体信息来自您正在使用的主机 ** //
    /** WordPress数据库的名称 */
    define( 'DB_NAME', 'wordpress' );
    
    /** MySQL数据库用户名 */
    define( 'DB_USER', 'root' );
    
    /** MySQL数据库密码 */
    define( 'DB_PASSWORD', 'root' );
    
    /** MySQL主机 */
    define( 'DB_HOST', 'localhost' );
    
    /** 创建数据表时默认的文字编码 */
    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);
    
    /* 好了!请不要再继续编辑。请保存本文件。使用愉快! */
    
    /** WordPress目录的绝对路径。 */
    if ( ! defined( 'ABSPATH' ) ) {
        define( 'ABSPATH', dirname( __FILE__ ) . '/' );
    }
    
    /** 设置WordPress变量和包含文件。 */
    require_once( ABSPATH . 'wp-settings.php' );
    
    

    【温馨提示】

    1.把前四行黄颜色部分改为你的数据

    2.最好用代码编辑器修改,记事本可能会打乱顺序。

    3.你可以把文件复制到本地命名为confing.php上传到你的服务器

    Linux Ubuntu可参考

    打开cmd命令行输入以下命令即可

    scp -r (本地文件路径)E:xxxxxxxxxconfig.php root@(公网IP)xx.xx.xxx:(上传路径)/xxx/xxxxx/xxx

    ========================================================

    刚接触wordpress的我在后台编辑文件时误删了这个重要的东东,刚建好的网站直接变成空白页了

    差点要我半条命,还好恢复过来了哈哈哈......


    ________________________________________________________

    Every good deed you do will someday come back to you.

    Love you,love word !
  • 相关阅读:
    ASP.NET Core管道详解[4]: 中间件委托链
    从执行上下文角度重新理解.NET(Core)的多线程编程[3]:安全上下文
    从执行上下文角度重新理解.NET(Core)的多线程编程[2]:同步上下文
    从执行上下文角度重新理解.NET(Core)的多线程编程[1]:基于调用链的”参数”传递
    ASP.NET Core管道详解[3]: Pipeline = IServer + IHttpApplication
    ASP.NET Core管道详解[2]: HttpContext本质论
    ASP.NET Core应用基本编程模式[5]:如何放置你的初始化代码
    如何实现Http请求报头的自动转发[设计篇]
    如何实现Http请求报头的自动转发[应用篇]
    采用”传统”方式获取当前HttpContext
  • 原文地址:https://www.cnblogs.com/hugboy/p/12591892.html
Copyright © 2011-2022 走看看