WordPress配置文件 wp-config.php 文件详解

前端之家收集整理的这篇文章主要介绍了WordPress配置文件 wp-config.php 文件详解前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

wp-config.php文件是什么?

wp-config.php文件wordpress建站配置文件,里面有wordpress数据库信息,语言信息。 wp-config.php 不是内建的文件,而是在安装过程中自动创建的文件

开始操作

修改前请备份此文件,一旦错误,网站将不能正常访问,请立即用备份的文件进行恢复。

通过FTP软件,连接至源文件空间,wp-config.php位于网站根目录,和wp-content文件夹位于同一目录,参考下图:

wpconfigfile

了解 wp-config.php 文件

首先看一下完整的 wp-config.php 文件

Crayon-5c891d6a689e1125575642" class="Crayon-Syntax Crayon-theme-classic Crayon-font-monaco Crayon-os-pc print-yes notranslate" data-settings=" minimize scroll-mouSEOver" style=" margin-top: 12px; margin-bottom: 12px; font-size: 12px !important; line-height: 15px !important;">
Crayon-toolbar" data-settings=" mouSEOver overlay hide delay" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;">Crayon-title">
Crayon-tools" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;">
Crayon-button Crayon-nums-button" title="Toggle Line Numbers">
Crayon-button-icon">
Crayon-button Crayon-plain-button" title="Toggle Plain Code">
Crayon-button-icon">
Crayon-button Crayon-wrap-button" title="Toggle Line Wrap">
Crayon-button-icon">
Crayon-button Crayon-expand-button" title="Expand Code">
Crayon-button-icon">
Crayon-button Crayon-copy-button" title="Copy">
Crayon-button-icon">
Crayon-button Crayon-popup-button" title="Open Code In New Window">
Crayon-button-icon">
Crayon-info" style="min-height: 16.8px !important; line-height: 16.8px !important;">
Crayon-plain-wrap">
Crayon-main" style="">Crayon-table">Crayon-row">
Crayon-nums " data-settings="show">
Crayon-nums-content" style="font-size: 12px !important; line-height: 15px !important;">
Crayon-num" data-line="Crayon-5c891d6a689e1125575642-1">1
Crayon-num Crayon-striped-num" data-line="Crayon-5c891d6a689e1125575642-2">2
Crayon-num" data-line="Crayon-5c891d6a689e1125575642-3">3
Crayon-num Crayon-striped-num" data-line="Crayon-5c891d6a689e1125575642-4">4
Crayon-num" data-line="Crayon-5c891d6a689e1125575642-5">5
Crayon-num Crayon-striped-num" data-line="Crayon-5c891d6a689e1125575642-6">6
Crayon-num" data-line="Crayon-5c891d6a689e1125575642-7">7
Crayon-num Crayon-striped-num" data-line="Crayon-5c891d6a689e1125575642-8">8
Crayon-num" data-line="Crayon-5c891d6a689e1125575642-9">9
Crayon-num Crayon-striped-num" data-line="Crayon-5c891d6a689e1125575642-10">10
Crayon-num" data-line="Crayon-5c891d6a689e1125575642-11">11
Crayon-num Crayon-striped-num" data-line="Crayon-5c891d6a689e1125575642-12">12
Crayon-num" data-line="Crayon-5c891d6a689e1125575642-13">13
Crayon-num Crayon-striped-num" data-line="Crayon-5c891d6a689e1125575642-14">14
Crayon-num" data-line="Crayon-5c891d6a689e1125575642-15">15
Crayon-num Crayon-striped-num" data-line="Crayon-5c891d6a689e1125575642-16">16
Crayon-num" data-line="Crayon-5c891d6a689e1125575642-17">17
Crayon-num Crayon-striped-num" data-line="Crayon-5c891d6a689e1125575642-18">18
Crayon-num" data-line="Crayon-5c891d6a689e1125575642-19">19
Crayon-num Crayon-striped-num" data-line="Crayon-5c891d6a689e1125575642-20">20
Crayon-num" data-line="Crayon-5c891d6a689e1125575642-21">21
Crayon-num Crayon-striped-num" data-line="Crayon-5c891d6a689e1125575642-22">22
Crayon-num" data-line="Crayon-5c891d6a689e1125575642-23">23
Crayon-num Crayon-striped-num" data-line="Crayon-5c891d6a689e1125575642-24">24
Crayon-num" data-line="Crayon-5c891d6a689e1125575642-25">25
Crayon-num Crayon-striped-num" data-line="Crayon-5c891d6a689e1125575642-26">26
Crayon-num" data-line="Crayon-5c891d6a689e1125575642-27">27
Crayon-num Crayon-striped-num" data-line="Crayon-5c891d6a689e1125575642-28">28
Crayon-num" data-line="Crayon-5c891d6a689e1125575642-29">29
Crayon-num Crayon-striped-num" data-line="Crayon-5c891d6a689e1125575642-30">30
Crayon-num" data-line="Crayon-5c891d6a689e1125575642-31">31
Crayon-num Crayon-striped-num" data-line="Crayon-5c891d6a689e1125575642-32">32
Crayon-num" data-line="Crayon-5c891d6a689e1125575642-33">33
Crayon-num Crayon-striped-num" data-line="Crayon-5c891d6a689e1125575642-34">34
Crayon-num" data-line="Crayon-5c891d6a689e1125575642-35">35
Crayon-num Crayon-striped-num" data-line="Crayon-5c891d6a689e1125575642-36">36
Crayon-num" data-line="Crayon-5c891d6a689e1125575642-37">37
Crayon-num Crayon-striped-num" data-line="Crayon-5c891d6a689e1125575642-38">38
Crayon-num" data-line="Crayon-5c891d6a689e1125575642-39">39
Crayon-num Crayon-striped-num" data-line="Crayon-5c891d6a689e1125575642-40">40
Crayon-num" data-line="Crayon-5c891d6a689e1125575642-41">41
Crayon-num Crayon-striped-num" data-line="Crayon-5c891d6a689e1125575642-42">42
Crayon-num" data-line="Crayon-5c891d6a689e1125575642-43">43
Crayon-num Crayon-striped-num" data-line="Crayon-5c891d6a689e1125575642-44">44
Crayon-num" data-line="Crayon-5c891d6a689e1125575642-45">45
Crayon-num Crayon-striped-num" data-line="Crayon-5c891d6a689e1125575642-46">46
Crayon-num" data-line="Crayon-5c891d6a689e1125575642-47">47
Crayon-num Crayon-striped-num" data-line="Crayon-5c891d6a689e1125575642-48">48
Crayon-num" data-line="Crayon-5c891d6a689e1125575642-49">49
Crayon-num Crayon-striped-num" data-line="Crayon-5c891d6a689e1125575642-50">50
Crayon-num" data-line="Crayon-5c891d6a689e1125575642-51">51
Crayon-num Crayon-striped-num" data-line="Crayon-5c891d6a689e1125575642-52">52
Crayon-num" data-line="Crayon-5c891d6a689e1125575642-53">53
Crayon-num Crayon-striped-num" data-line="Crayon-5c891d6a689e1125575642-54">54
Crayon-num" data-line="Crayon-5c891d6a689e1125575642-55">55
Crayon-num Crayon-striped-num" data-line="Crayon-5c891d6a689e1125575642-56">56
Crayon-num" data-line="Crayon-5c891d6a689e1125575642-57">57
Crayon-num Crayon-striped-num" data-line="Crayon-5c891d6a689e1125575642-58">58
Crayon-num" data-line="Crayon-5c891d6a689e1125575642-59">59
Crayon-num Crayon-striped-num" data-line="Crayon-5c891d6a689e1125575642-60">60
Crayon-num" data-line="Crayon-5c891d6a689e1125575642-61">61
Crayon-num Crayon-striped-num" data-line="Crayon-5c891d6a689e1125575642-62">62
Crayon-num" data-line="Crayon-5c891d6a689e1125575642-63">63
Crayon-num Crayon-striped-num" data-line="Crayon-5c891d6a689e1125575642-64">64
Crayon-num" data-line="Crayon-5c891d6a689e1125575642-65">65
Crayon-num Crayon-striped-num" data-line="Crayon-5c891d6a689e1125575642-66">66
Crayon-num" data-line="Crayon-5c891d6a689e1125575642-67">67
Crayon-num Crayon-striped-num" data-line="Crayon-5c891d6a689e1125575642-68">68
Crayon-num" data-line="Crayon-5c891d6a689e1125575642-69">69
Crayon-num Crayon-striped-num" data-line="Crayon-5c891d6a689e1125575642-70">70
Crayon-num" data-line="Crayon-5c891d6a689e1125575642-71">71
Crayon-num Crayon-striped-num" data-line="Crayon-5c891d6a689e1125575642-72">72
Crayon-num" data-line="Crayon-5c891d6a689e1125575642-73">73
Crayon-num Crayon-striped-num" data-line="Crayon-5c891d6a689e1125575642-74">74
Crayon-num" data-line="Crayon-5c891d6a689e1125575642-75">75
Crayon-num Crayon-striped-num" data-line="Crayon-5c891d6a689e1125575642-76">76
Crayon-num" data-line="Crayon-5c891d6a689e1125575642-77">77
Crayon-num Crayon-striped-num" data-line="Crayon-5c891d6a689e1125575642-78">78
Crayon-num" data-line="Crayon-5c891d6a689e1125575642-79">79
Crayon-num Crayon-striped-num" data-line="Crayon-5c891d6a689e1125575642-80">80
Crayon-num" data-line="Crayon-5c891d6a689e1125575642-81">81
Crayon-num Crayon-striped-num" data-line="Crayon-5c891d6a689e1125575642-82">82
Crayon-num" data-line="Crayon-5c891d6a689e1125575642-83">83
Crayon-num Crayon-striped-num" data-line="Crayon-5c891d6a689e1125575642-84">84
Crayon-num" data-line="Crayon-5c891d6a689e1125575642-85">85
Crayon-num Crayon-striped-num" data-line="Crayon-5c891d6a689e1125575642-86">86
Crayon-num" data-line="Crayon-5c891d6a689e1125575642-87">87
Crayon-num Crayon-striped-num" data-line="Crayon-5c891d6a689e1125575642-88">88
Crayon-num" data-line="Crayon-5c891d6a689e1125575642-89">89
Crayon-code">
Crayon-pre" style="font-size: 12px !important; line-height: 15px !important; -moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4;">
Crayon-line" id="Crayon-5c891d6a689e1125575642-1">Crayon-o"><Crayon-sy">?Crayon-v">PHP
Crayon-line Crayon-striped-line" id="Crayon-5c891d6a689e1125575642-2">Crayon-c">/**
Crayon-line" id="Crayon-5c891d6a689e1125575642-3">Crayon-c"> * The base configuration for wordpress
Crayon-line Crayon-striped-line" id="Crayon-5c891d6a689e1125575642-4">Crayon-c"> *
Crayon-line" id="Crayon-5c891d6a689e1125575642-5">Crayon-c"> * The wp-config.php creation script uses this file during the
Crayon-line Crayon-striped-line" id="Crayon-5c891d6a689e1125575642-6">Crayon-c"> * installation. You don't have to use the web site,you can
Crayon-line" id="Crayon-5c891d6a689e1125575642-7">Crayon-c"> * copy this file to "wp-config.php" and fill in the values.
Crayon-line Crayon-striped-line" id="Crayon-5c891d6a689e1125575642-8">Crayon-c"> *
Crayon-line" id="Crayon-5c891d6a689e1125575642-9">Crayon-c"> * This file contains the following configurations:
Crayon-line Crayon-striped-line" id="Crayon-5c891d6a689e1125575642-10">Crayon-c"> *
Crayon-line" id="Crayon-5c891d6a689e1125575642-11">Crayon-c"> * * MysqL settings
Crayon-line Crayon-striped-line" id="Crayon-5c891d6a689e1125575642-12">Crayon-c"> * * Secret keys
Crayon-line" id="Crayon-5c891d6a689e1125575642-13">Crayon-c"> * * Database table prefix
Crayon-line Crayon-striped-line" id="Crayon-5c891d6a689e1125575642-14">Crayon-c"> * * ABSPATH
Crayon-line" id="Crayon-5c891d6a689e1125575642-15">Crayon-c"> *
Crayon-line Crayon-striped-line" id="Crayon-5c891d6a689e1125575642-16">Crayon-c"> * @link https://codex.wordpress.org/Editing_wp-config.php
Crayon-line" id="Crayon-5c891d6a689e1125575642-17">Crayon-c"> *
Crayon-line Crayon-striped-line" id="Crayon-5c891d6a689e1125575642-18">Crayon-c"> * @package wordpress
Crayon-line" id="Crayon-5c891d6a689e1125575642-19">Crayon-c"> */
Crayon-line Crayon-striped-line" id="Crayon-5c891d6a689e1125575642-20">
Crayon-line" id="Crayon-5c891d6a689e1125575642-21">Crayon-c">// ** MysqL settings - You can get this info from your web host ** //
Crayon-line Crayon-striped-line" id="Crayon-5c891d6a689e1125575642-22">Crayon-c">/** The name of the database for wordpress */
Crayon-line" id="Crayon-5c891d6a689e1125575642-23">Crayon-e">defineCrayon-sy">(Crayon-s">'DB_NAME'Crayon-sy">,Crayon-h"> Crayon-s">'database_name_here'Crayon-sy">)Crayon-sy">;
Crayon-line Crayon-striped-line" id="Crayon-5c891d6a689e1125575642-24">
Crayon-line" id="Crayon-5c891d6a689e1125575642-25">Crayon-c">/** MysqL database username */
Crayon-line Crayon-striped-line" id="Crayon-5c891d6a689e1125575642-26">Crayon-e">defineCrayon-sy">(Crayon-s">'DB_USER'Crayon-sy">,Crayon-h"> Crayon-s">'username_here'Crayon-sy">)Crayon-sy">;
Crayon-line" id="Crayon-5c891d6a689e1125575642-27">
Crayon-line Crayon-striped-line" id="Crayon-5c891d6a689e1125575642-28">Crayon-c">/** MysqL database password */
Crayon-line" id="Crayon-5c891d6a689e1125575642-29">Crayon-e">defineCrayon-sy">(Crayon-s">'DB_PASSWORD'Crayon-sy">,Crayon-h"> Crayon-s">'password_here'Crayon-sy">)Crayon-sy">;
Crayon-line Crayon-striped-line" id="Crayon-5c891d6a689e1125575642-30">
Crayon-line" id="Crayon-5c891d6a689e1125575642-31">Crayon-c">/** MysqL hostname */
Crayon-line Crayon-striped-line" id="Crayon-5c891d6a689e1125575642-32">Crayon-e">defineCrayon-sy">(Crayon-s">'DB_HOST'Crayon-sy">,Crayon-h"> Crayon-s">'localhost'Crayon-sy">)Crayon-sy">;
Crayon-line" id="Crayon-5c891d6a689e1125575642-33">
Crayon-line Crayon-striped-line" id="Crayon-5c891d6a689e1125575642-34">Crayon-c">/** Database Charset to use in creating database tables. */
Crayon-line" id="Crayon-5c891d6a689e1125575642-35">Crayon-e">defineCrayon-sy">(Crayon-s">'DB_CHARSET'Crayon-sy">,Crayon-h"> Crayon-s">'utf8'Crayon-sy">)Crayon-sy">;
Crayon-line Crayon-striped-line" id="Crayon-5c891d6a689e1125575642-36">
Crayon-line" id="Crayon-5c891d6a689e1125575642-37">Crayon-c">/** The Database Collate type. Don't change this if in doubt. */
Crayon-line Crayon-striped-line" id="Crayon-5c891d6a689e1125575642-38">Crayon-e">defineCrayon-sy">(Crayon-s">'DB_COLLATE'Crayon-sy">,Crayon-h"> Crayon-s">''Crayon-sy">)Crayon-sy">;
Crayon-line" id="Crayon-5c891d6a689e1125575642-39">
Crayon-line Crayon-striped-line" id="Crayon-5c891d6a689e1125575642-40">Crayon-c">/**#@+
Crayon-line" id="Crayon-5c891d6a689e1125575642-41">Crayon-c"> * Authentication Unique Keys and Salts.
Crayon-line Crayon-striped-line" id="Crayon-5c891d6a689e1125575642-42">Crayon-c"> *
Crayon-line" id="Crayon-5c891d6a689e1125575642-43">Crayon-c"> * Change these to different unique phrases!
Crayon-line Crayon-striped-line" id="Crayon-5c891d6a689e1125575642-44">Crayon-c"> * You can generate these using the {@link https://api.wordpress.org/secret-key/1.1/salt/ wordpress.org secret-key service}
Crayon-line" id="Crayon-5c891d6a689e1125575642-45">Crayon-c"> * 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.
Crayon-line Crayon-striped-line" id="Crayon-5c891d6a689e1125575642-46">Crayon-c"> *
Crayon-line" id="Crayon-5c891d6a689e1125575642-47">Crayon-c"> * @since 2.6.0
Crayon-line Crayon-striped-line" id="Crayon-5c891d6a689e1125575642-48">Crayon-c"> */
Crayon-line" id="Crayon-5c891d6a689e1125575642-49">Crayon-e">defineCrayon-sy">(Crayon-s">'AUTH_KEY'Crayon-sy">,Crayon-h"> Crayon-s">'put your unique phrase here'Crayon-sy">)Crayon-sy">;
Crayon-line Crayon-striped-line" id="Crayon-5c891d6a689e1125575642-50">Crayon-e">defineCrayon-sy">(Crayon-s">'SECURE_AUTH_KEY'Crayon-sy">,Crayon-h">Crayon-s">'put your unique phrase here'Crayon-sy">)Crayon-sy">;
Crayon-line" id="Crayon-5c891d6a689e1125575642-51">Crayon-e">defineCrayon-sy">(Crayon-s">'LOGGED_IN_KEY'Crayon-sy">,Crayon-h">Crayon-s">'put your unique phrase here'Crayon-sy">)Crayon-sy">;
Crayon-line Crayon-striped-line" id="Crayon-5c891d6a689e1125575642-52">Crayon-e">defineCrayon-sy">(Crayon-s">'NONCE_KEY'Crayon-sy">,Crayon-h">Crayon-s">'put your unique phrase here'Crayon-sy">)Crayon-sy">;
Crayon-line" id="Crayon-5c891d6a689e1125575642-53">Crayon-e">defineCrayon-sy">(Crayon-s">'AUTH_SALT'Crayon-sy">,Crayon-h">Crayon-s">'put your unique phrase here'Crayon-sy">)Crayon-sy">;
Crayon-line Crayon-striped-line" id="Crayon-5c891d6a689e1125575642-54">Crayon-e">defineCrayon-sy">(Crayon-s">'SECURE_AUTH_SALT'Crayon-sy">,Crayon-h"> Crayon-s">'put your unique phrase here'Crayon-sy">)Crayon-sy">;
Crayon-line" id="Crayon-5c891d6a689e1125575642-55">Crayon-e">defineCrayon-sy">(Crayon-s">'LOGGED_IN_SALT'Crayon-sy">,Crayon-h"> Crayon-s">'put your unique phrase here'Crayon-sy">)Crayon-sy">;
Crayon-line Crayon-striped-line" id="Crayon-5c891d6a689e1125575642-56">Crayon-e">defineCrayon-sy">(Crayon-s">'NONCE_SALT'Crayon-sy">,Crayon-h"> Crayon-s">'put your unique phrase here'Crayon-sy">)Crayon-sy">;
Crayon-line" id="Crayon-5c891d6a689e1125575642-57">
Crayon-line Crayon-striped-line" id="Crayon-5c891d6a689e1125575642-58">Crayon-c">/**#@-*/
Crayon-line" id="Crayon-5c891d6a689e1125575642-59">
Crayon-line Crayon-striped-line" id="Crayon-5c891d6a689e1125575642-60">Crayon-c">/**
Crayon-line" id="Crayon-5c891d6a689e1125575642-61">Crayon-c"> * wordpress Database Table prefix.
Crayon-line Crayon-striped-line" id="Crayon-5c891d6a689e1125575642-62">Crayon-c"> *
Crayon-line" id="Crayon-5c891d6a689e1125575642-63">Crayon-c"> * You can have multiple installations in one database if you give each
Crayon-line Crayon-striped-line" id="Crayon-5c891d6a689e1125575642-64">Crayon-c"> * a unique prefix. Only numbers,and underscores please!
Crayon-line" id="Crayon-5c891d6a689e1125575642-65">Crayon-c"> */
Crayon-line Crayon-striped-line" id="Crayon-5c891d6a689e1125575642-66">Crayon-sy">$Crayon-v">table_prefixCrayon-h">Crayon-o">=Crayon-h"> Crayon-s">'wp_'Crayon-sy">;
Crayon-line" id="Crayon-5c891d6a689e1125575642-67">
Crayon-line Crayon-striped-line" id="Crayon-5c891d6a689e1125575642-68">Crayon-c">/**
Crayon-line" id="Crayon-5c891d6a689e1125575642-69">Crayon-c"> * For developers: wordpress debugging mode.
Crayon-line Crayon-striped-line" id="Crayon-5c891d6a689e1125575642-70">Crayon-c"> *
Crayon-line" id="Crayon-5c891d6a689e1125575642-71">Crayon-c"> * Change this to true to enable the display of notices during development.
Crayon-line Crayon-striped-line" id="Crayon-5c891d6a689e1125575642-72">Crayon-c"> * It is strongly recommended that plugin and theme developers use WP_DEBUG
Crayon-line" id="Crayon-5c891d6a689e1125575642-73">Crayon-c"> * in their development environments.
Crayon-line Crayon-striped-line" id="Crayon-5c891d6a689e1125575642-74">Crayon-c"> *
Crayon-line" id="Crayon-5c891d6a689e1125575642-75">Crayon-c"> * For information on other constants that can be used for debugging,
Crayon-line Crayon-striped-line" id="Crayon-5c891d6a689e1125575642-76">Crayon-c"> * visit the Codex.
Crayon-line" id="Crayon-5c891d6a689e1125575642-77">Crayon-c"> *
Crayon-line Crayon-striped-line" id="Crayon-5c891d6a689e1125575642-78">Crayon-c"> * @link https://codex.wordpress.org/Debugging_in_wordpress
Crayon-line" id="Crayon-5c891d6a689e1125575642-79">Crayon-c"> */
Crayon-line Crayon-striped-line" id="Crayon-5c891d6a689e1125575642-80">Crayon-e">defineCrayon-sy">(Crayon-s">'WP_DEBUG'Crayon-sy">,Crayon-h"> Crayon-t">falseCrayon-sy">)Crayon-sy">;
Crayon-line" id="Crayon-5c891d6a689e1125575642-81">
Crayon-line Crayon-striped-line" id="Crayon-5c891d6a689e1125575642-82">Crayon-c">/* That's all,stop editing! Happy blogging. */
Crayon-line" id="Crayon-5c891d6a689e1125575642-83">
Crayon-line Crayon-striped-line" id="Crayon-5c891d6a689e1125575642-84">Crayon-c">/** Absolute path to the wordpress directory. */
Crayon-line" id="Crayon-5c891d6a689e1125575642-85">Crayon-st">ifCrayon-h"> Crayon-sy">(Crayon-h"> Crayon-o">!Crayon-e">definedCrayon-sy">(Crayon-s">'ABSPATH'Crayon-sy">)Crayon-h"> Crayon-sy">)
Crayon-line Crayon-striped-line" id="Crayon-5c891d6a689e1125575642-86">Crayon-h"> Crayon-e">defineCrayon-sy">(Crayon-s">'ABSPATH'Crayon-sy">,Crayon-h"> Crayon-e">dirnameCrayon-sy">(Crayon-v">__FILE__Crayon-sy">)Crayon-h"> Crayon-sy">.Crayon-h"> Crayon-s">'/'Crayon-sy">)Crayon-sy">;
Crayon-line" id="Crayon-5c891d6a689e1125575642-87">
Crayon-line Crayon-striped-line" id="Crayon-5c891d6a689e1125575642-88">Crayon-c">/** Sets up wordpress vars and included files. */
Crayon-line" id="Crayon-5c891d6a689e1125575642-89">Crayon-e">require_onceCrayon-sy">(Crayon-i">ABSPATHCrayon-h"> Crayon-sy">.Crayon-h"> Crayon-s">'wp-settings.PHP'Crayon-sy">)Crayon-sy">;

数据库信息配置

数据库信息出现在wp-config.php 文件中 ‘MysqL Settings’ 的下方。您需要替换成自己的数据库信息,包含数据库地址,数据库用户名数据库密码,数据库名称

Crayon-5c891d6a689e9587926459" class="Crayon-Syntax Crayon-theme-classic Crayon-font-monaco Crayon-os-pc print-yes notranslate" data-settings=" minimize scroll-mouSEOver" style=" margin-top: 12px; margin-bottom: 12px; font-size: 12px !important; line-height: 15px !important;">
Crayon-toolbar" data-settings=" mouSEOver overlay hide delay" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;">Crayon-title">
Crayon-tools" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;">
Crayon-button Crayon-nums-button" title="Toggle Line Numbers">
Crayon-button-icon">
Crayon-button Crayon-plain-button" title="Toggle Plain Code">
Crayon-button-icon">
Crayon-button Crayon-wrap-button" title="Toggle Line Wrap">
Crayon-button-icon">
Crayon-button Crayon-expand-button" title="Expand Code">
Crayon-button-icon">
Crayon-button Crayon-copy-button" title="Copy">
Crayon-button-icon">
Crayon-button Crayon-popup-button" title="Open Code In New Window">
Crayon-button-icon">
Crayon-info" style="min-height: 16.8px !important; line-height: 16.8px !important;">
Crayon-plain-wrap">
Crayon-main" style="">Crayon-table">Crayon-row">
Crayon-nums " data-settings="show">
Crayon-nums-content" style="font-size: 12px !important; line-height: 15px !important;">
Crayon-num" data-line="Crayon-5c891d6a689e9587926459-1">1
Crayon-num Crayon-striped-num" data-line="Crayon-5c891d6a689e9587926459-2">2
Crayon-num" data-line="Crayon-5c891d6a689e9587926459-3">3
Crayon-num Crayon-striped-num" data-line="Crayon-5c891d6a689e9587926459-4">4
Crayon-num" data-line="Crayon-5c891d6a689e9587926459-5">5
Crayon-num Crayon-striped-num" data-line="Crayon-5c891d6a689e9587926459-6">6
Crayon-num" data-line="Crayon-5c891d6a689e9587926459-7">7
Crayon-num Crayon-striped-num" data-line="Crayon-5c891d6a689e9587926459-8">8
Crayon-num" data-line="Crayon-5c891d6a689e9587926459-9">9
Crayon-num Crayon-striped-num" data-line="Crayon-5c891d6a689e9587926459-10">10
Crayon-num" data-line="Crayon-5c891d6a689e9587926459-11">11
Crayon-num Crayon-striped-num" data-line="Crayon-5c891d6a689e9587926459-12">12
Crayon-num" data-line="Crayon-5c891d6a689e9587926459-13">13
Crayon-num Crayon-striped-num" data-line="Crayon-5c891d6a689e9587926459-14">14
Crayon-num" data-line="Crayon-5c891d6a689e9587926459-15">15
Crayon-num Crayon-striped-num" data-line="Crayon-5c891d6a689e9587926459-16">16
Crayon-num" data-line="Crayon-5c891d6a689e9587926459-17">17
Crayon-num Crayon-striped-num" data-line="Crayon-5c891d6a689e9587926459-18">18
Crayon-code">
Crayon-pre" style="font-size: 12px !important; line-height: 15px !important; -moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4;">
Crayon-line" id="Crayon-5c891d6a689e9587926459-1">Crayon-c">// ** MysqL settings - You can get this info from your web host ** //
Crayon-line Crayon-striped-line" id="Crayon-5c891d6a689e9587926459-2">Crayon-c">/** The name of the database for wordpress */
Crayon-line" id="Crayon-5c891d6a689e9587926459-3">Crayon-e">defineCrayon-sy">(Crayon-s">'DB_NAME'Crayon-sy">,Crayon-h"> Crayon-s">'database_name_here'Crayon-sy">)Crayon-sy">;
Crayon-line Crayon-striped-line" id="Crayon-5c891d6a689e9587926459-4">
Crayon-line" id="Crayon-5c891d6a689e9587926459-5">Crayon-c">/** MysqL database username */
Crayon-line Crayon-striped-line" id="Crayon-5c891d6a689e9587926459-6">Crayon-e">defineCrayon-sy">(Crayon-s">'DB_USER'Crayon-sy">,Crayon-h"> Crayon-s">'username_here'Crayon-sy">)Crayon-sy">;
Crayon-line" id="Crayon-5c891d6a689e9587926459-7">
Crayon-line Crayon-striped-line" id="Crayon-5c891d6a689e9587926459-8">Crayon-c">/** MysqL database password */
Crayon-line" id="Crayon-5c891d6a689e9587926459-9">Crayon-e">defineCrayon-sy">(Crayon-s">'DB_PASSWORD'Crayon-sy">,Crayon-h"> Crayon-s">'password_here'Crayon-sy">)Crayon-sy">;
Crayon-line Crayon-striped-line" id="Crayon-5c891d6a689e9587926459-10">
Crayon-line" id="Crayon-5c891d6a689e9587926459-11">Crayon-c">/** MysqL hostname */
Crayon-line Crayon-striped-line" id="Crayon-5c891d6a689e9587926459-12">Crayon-e">defineCrayon-sy">(Crayon-s">'DB_HOST'Crayon-sy">,Crayon-h"> Crayon-s">'localhost'Crayon-sy">)Crayon-sy">;
Crayon-line" id="Crayon-5c891d6a689e9587926459-13">
Crayon-line Crayon-striped-line" id="Crayon-5c891d6a689e9587926459-14">Crayon-c">/** Database Charset to use in creating database tables. */
Crayon-line" id="Crayon-5c891d6a689e9587926459-15">Crayon-e">defineCrayon-sy">(Crayon-s">'DB_CHARSET'Crayon-sy">,Crayon-h"> Crayon-s">'utf8'Crayon-sy">)Crayon-sy">;
Crayon-line Crayon-striped-line" id="Crayon-5c891d6a689e9587926459-16">
Crayon-line" id="Crayon-5c891d6a689e9587926459-17">Crayon-c">/** The Database Collate type. Don't change this if in doubt. */
Crayon-line Crayon-striped-line" id="Crayon-5c891d6a689e9587926459-18">Crayon-e">defineCrayon-sy">(Crayon-s">'DB_COLLATE'Crayon-sy">,Crayon-h"> Crayon-s">''Crayon-sy">)Crayon-sy">;

数据库前缀

默认的是’wp_’, 可以修改成自己想要的。

Crayon-5c891d6a689ec040701255" class="Crayon-Syntax Crayon-theme-classic Crayon-font-monaco Crayon-os-pc print-yes notranslate" data-settings=" minimize scroll-mouSEOver" style=" margin-top: 12px; margin-bottom: 12px; font-size: 12px !important; line-height: 15px !important;">
Crayon-toolbar" data-settings=" mouSEOver overlay hide delay" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;">Crayon-title">
Crayon-tools" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;">
Crayon-button Crayon-nums-button" title="Toggle Line Numbers">
Crayon-button-icon">
Crayon-button Crayon-plain-button" title="Toggle Plain Code">
Crayon-button-icon">
Crayon-button Crayon-wrap-button" title="Toggle Line Wrap">
Crayon-button-icon">
Crayon-button Crayon-expand-button" title="Expand Code">
Crayon-button-icon">
Crayon-button Crayon-copy-button" title="Copy">
Crayon-button-icon">
Crayon-button Crayon-popup-button" title="Open Code In New Window">
Crayon-button-icon">
Crayon-info" style="min-height: 16.8px !important; line-height: 16.8px !important;">
Crayon-plain-wrap">
Crayon-main" style="">Crayon-table">Crayon-row">
Crayon-nums " data-settings="show">
Crayon-nums-content" style="font-size: 12px !important; line-height: 15px !important;">
Crayon-num" data-line="Crayon-5c891d6a689ec040701255-1">1
Crayon-num Crayon-striped-num" data-line="Crayon-5c891d6a689ec040701255-2">2
Crayon-num" data-line="Crayon-5c891d6a689ec040701255-3">3
Crayon-num Crayon-striped-num" data-line="Crayon-5c891d6a689ec040701255-4">4
Crayon-num" data-line="Crayon-5c891d6a689ec040701255-5">5
Crayon-num Crayon-striped-num" data-line="Crayon-5c891d6a689ec040701255-6">6
Crayon-num" data-line="Crayon-5c891d6a689ec040701255-7">7
Crayon-code">
Crayon-pre" style="font-size: 12px !important; line-height: 15px !important; -moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4;">
Crayon-line" id="Crayon-5c891d6a689ec040701255-1">Crayon-c">/**
Crayon-line Crayon-striped-line" id="Crayon-5c891d6a689ec040701255-2">Crayon-c"> * wordpress Database Table prefix.
Crayon-line" id="Crayon-5c891d6a689ec040701255-3">Crayon-c"> *
Crayon-line Crayon-striped-line" id="Crayon-5c891d6a689ec040701255-4">Crayon-c"> * You can have multiple installations in one database if you give each
Crayon-line" id="Crayon-5c891d6a689ec040701255-5">Crayon-c"> * a unique prefix. Only numbers,and underscores please!
Crayon-line Crayon-striped-line" id="Crayon-5c891d6a689ec040701255-6">Crayon-c"> */
Crayon-line" id="Crayon-5c891d6a689ec040701255-7">Crayon-sy">$Crayon-v">table_prefixCrayon-h">Crayon-o">=Crayon-h"> Crayon-s">'wp_'Crayon-sy">;

使用wp-config.php文件修改wordpress网站的链接

当您需要更换域名,把网站转移到一个新的空间时,可以通过后台的设置更改wordpress链接

wordpressurls

也可以通过修改 wp-config.php 文件来实现,只需在 wp-config.php 文件添加下面两行代码就可以实现。

Crayon-5c891d6a689ee141104334" class="Crayon-Syntax Crayon-theme-classic Crayon-font-monaco Crayon-os-pc print-yes notranslate" data-settings=" minimize scroll-mouSEOver" style=" margin-top: 12px; margin-bottom: 12px; font-size: 12px !important; line-height: 15px !important;">
Crayon-toolbar" data-settings=" mouSEOver overlay hide delay" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;">Crayon-title">
Crayon-tools" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;">
Crayon-button Crayon-nums-button" title="Toggle Line Numbers">
Crayon-button-icon">
Crayon-button Crayon-plain-button" title="Toggle Plain Code">
Crayon-button-icon">
Crayon-button Crayon-wrap-button" title="Toggle Line Wrap">
Crayon-button-icon">
Crayon-button Crayon-expand-button" title="Expand Code">
Crayon-button-icon">
Crayon-button Crayon-copy-button" title="Copy">
Crayon-button-icon">
Crayon-button Crayon-popup-button" title="Open Code In New Window">
Crayon-button-icon">
Crayon-info" style="min-height: 16.8px !important; line-height: 16.8px !important;">
Crayon-plain-wrap">
Crayon-main" style="">Crayon-table">Crayon-row">
Crayon-nums " data-settings="show">
Crayon-nums-content" style="font-size: 12px !important; line-height: 15px !important;">
Crayon-num" data-line="Crayon-5c891d6a689ee141104334-1">1
Crayon-num Crayon-striped-num" data-line="Crayon-5c891d6a689ee141104334-2">2
Crayon-code">
Crayon-pre" style="font-size: 12px !important; line-height: 15px !important; -moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4;">
Crayon-line" id="Crayon-5c891d6a689ee141104334-1">Crayon-e">defineCrayon-sy">(Crayon-s">'WP_HOME'Crayon-sy">,Crayon-s">'http://example.com'Crayon-sy">)Crayon-sy">;
Crayon-line Crayon-striped-line" id="Crayon-5c891d6a689ee141104334-2">Crayon-e">defineCrayon-sy">(Crayon-s">'WP_SITEURL'Crayon-sy">,Crayon-s">'http://example.com'Crayon-sy">)Crayon-sy">;

改变文件上传路径

wordpress 默认将媒体文件上传到 /wp-content/uploads/ 路径,可以通过添加下面代码上传自定义文件夹中。

Crayon-5c891d6a689ef799522811" class="Crayon-Syntax Crayon-theme-classic Crayon-font-monaco Crayon-os-pc print-yes notranslate" data-settings=" minimize scroll-mouSEOver" style=" margin-top: 12px; margin-bottom: 12px; font-size: 12px !important; line-height: 15px !important;">
Crayon-toolbar" data-settings=" mouSEOver overlay hide delay" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;">Crayon-title">
Crayon-tools" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;">
Crayon-button Crayon-nums-button" title="Toggle Line Numbers">
Crayon-button-icon">
Crayon-button Crayon-plain-button" title="Toggle Plain Code">
Crayon-button-icon">
Crayon-button Crayon-wrap-button" title="Toggle Line Wrap">
Crayon-button-icon">
Crayon-button Crayon-expand-button" title="Expand Code">
Crayon-button-icon">
Crayon-button Crayon-copy-button" title="Copy">
Crayon-button-icon">
Crayon-button Crayon-popup-button" title="Open Code In New Window">
Crayon-button-icon">
Crayon-info" style="min-height: 16.8px !important; line-height: 16.8px !important;">
Crayon-plain-wrap">
Crayon-main" style="">Crayon-table">Crayon-row">
Crayon-nums " data-settings="show">
Crayon-nums-content" style="font-size: 12px !important; line-height: 15px !important;">
Crayon-num" data-line="Crayon-5c891d6a689ef799522811-1">1
Crayon-code">
Crayon-pre" style="font-size: 12px !important; line-height: 15px !important; -moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4;">
Crayon-line" id="Crayon-5c891d6a689ef799522811-1">Crayon-e">defineCrayon-sy">(Crayon-h"> Crayon-s">'UPLOADS'Crayon-sy">,Crayon-h"> Crayon-s">'wp-content/media'Crayon-h"> Crayon-sy">)Crayon-sy">;

禁止自动更新

wordpress从3.7版本开始,增加自动更新的功能自动更新对安全性有好处,但是有时候会出现一些错误,使网站不能正常访问。可以添加下面的代码禁止wordpress自动更新。

Crayon-5c891d6a689f1873871071" class="Crayon-Syntax Crayon-theme-classic Crayon-font-monaco Crayon-os-pc print-yes notranslate" data-settings=" minimize scroll-mouSEOver" style=" margin-top: 12px; margin-bottom: 12px; font-size: 12px !important; line-height: 15px !important;">
Crayon-toolbar" data-settings=" mouSEOver overlay hide delay" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;">Crayon-title">
Crayon-tools" style="font-size: 12px !important;height: 18px !important; line-height: 18px !important;">
Crayon-button Crayon-nums-button" title="Toggle Line Numbers">
Crayon-button-icon">
Crayon-button Crayon-plain-button" title="Toggle Plain Code">
Crayon-button-icon">
Crayon-button Crayon-wrap-button" title="Toggle Line Wrap">
Crayon-button-icon">
Crayon-button Crayon-expand-button" title="Expand Code">
Crayon-button-icon">
Crayon-button Crayon-copy-button" title="Copy">
Crayon-button-icon">
Crayon-button Crayon-popup-button" title="Open Code In New Window">
Crayon-button-icon">
Crayon-info" style="min-height: 16.8px !important; line-height: 16.8px !important;">
Crayon-plain-wrap">
Crayon-main" style="">Crayon-table">Crayon-row">
Crayon-nums " data-settings="show">
Crayon-nums-content" style="font-size: 12px !important; line-height: 15px !important;">
Crayon-num" data-line="Crayon-5c891d6a689f1873871071-1">1
Crayon-code">
Crayon-pre" style="font-size: 12px !important; line-height: 15px !important; -moz-tab-size:4; -o-tab-size:4; -webkit-tab-size:4; tab-size:4;">
Crayon-line" id="Crayon-5c891d6a689f1873871071-1">Crayon-e">defineCrayon-sy">(Crayon-h"> Crayon-s">'WP_AUTO_UPDATE_CORE'Crayon-sy">,Crayon-h"> Crayon-t">falseCrayon-h"> Crayon-sy">)Crayon-sy">;

原文链接:https://www.f2er.com/wordpress/238536.html

猜你在找的wordpress相关文章