站长百科 | 数字化技能提升教程 数字化时代生存宝典
首页
数字化百科
电子书
▼
建站程序
开发
服务器
办公软件
开发教程
▼
服务器教程
软件使用教程
运营教程
热门电子书
▼
CSS教程
WordPress教程
导航
程序频道
推广频道
网赚频道
人物频道
网站程序
网页制作
云计算
服务器
CMS
论坛
网店
虚拟主机
cPanel
网址导航
WIKI使用导航
WIKI首页
热点词条
最新资讯
网站程序
站长人物
页面分类
使用帮助
编辑测试
创建条目
网站地图
站长百科导航
站长百科
主机侦探
IDCtalk云说
跨境电商导航
WordPress啦
站长专题
网站推广
网站程序
网站赚钱
虚拟主机
cPanel
网址导航专题
云计算
微博营销
虚拟主机管理系统
开放平台
WIKI程序与应用
美国十大主机
编辑“
WordPress:Editing wp-config.php
”(章节)
人物百科
|
营销百科
|
网赚百科
|
站长工具
|
网站程序
|
域名主机
|
互联网公司
|
分类索引
跳转至:
导航
、
搜索
警告:
您没有登录。如果您做出任意编辑,您的IP地址将会公开可见。如果您
登录
或
创建
一个账户,您的编辑将归属于您的用户名,且将享受其他好处。
反垃圾检查。
不要
加入这个!
== 创建文件 == Open the file <tt>wp-config-sample.php</tt> in a [[WordPress:Glossary#Text_editor|text editor]]. 在一个[[WordPress:Glossary#Text_editor|文本编辑器]]中打开文件<tt>wp-config-sample.php</tt>。 '''Important:''' ''never'' use a word processor like Microsoft Word for editing WordPress files! '''注意:''' ''千万''别使用文字处理器,如Microsoft Word 编辑WordPress文件! === Database name === === 数据库名 === Find the line that says: 找到这一行: define('DB_NAME', 'putyourdbnamehere'); // The name of the database define('DB_NAME', 'putyourdbnamehere'); // 数据库名称 ('''NOTE:''' Everything on these lines you see after the <tt>//</tt> are comments for information purposes only.) ('''注:'''这一行中 <tt>//</tt> 后面的内容,这是评论注释。) Where it says <tt>'putyourdbnamehere'</tt>, delete ''putyourdbnamehere'' and enter the name of your database. '''Make sure that you don't accidentally delete the single quotation marks!''' 在<tt>'putyourdbnamehere'</tt>的位置,删除''putyourdbnamehere''并且输入你的数据库的名称。'''确定你没有错删了一些单引号!''' The line should look like this: 看起来像: define('DB_NAME', 'myDatabasename'); // The name of the database define('DB_NAME', 'myDatabasename'); // 数据库名 === Database user name === === 数据库用户名 === define('DB_USER', 'usernamehere'); // Your MySQL username Delete ''usernamehere'' and enter in your own username: 定义('DB_USER', 'usernamehere'); // 你的MySQL 用户名 删除 ''usernamehere'' 并且输入你自己的用户名: define('DB_USER', 'myDatabaseUser'); // Your MySQL username 定义('DB_USER', 'myDatabaseUser'); // 你的 MySQL 用户名 === Database password === === 数据库密码 === On to the next one: 另一个: define('DB_PASSWORD', 'yourpasswordhere'); // ...and password Delete ''yourpasswordhere'' and enter in your MySQL password: define('DB_PASSWORD', 'MyOwnPassword'); // ...and password 定义('DB_PASSWORD', 'yourpasswordhere'); // ...和密码 删除 ''yourpasswordhere'' 并且输入你自己的 MySQL 密码: 定义('DB_PASSWORD', 'MyOwnPassword'); // ...和密码 This is only an example password, of course! :) 当然,这只是一个密码的例子! :) ===Database host=== ===数据库主机=== The next line under the password line defines the host for your database. There is a 99% chance you will '''NOT''' have to change it unless your web host tells you otherwise. In other words, you can likely leave it as the default value of <tt>'localhost'</tt>. 密码行下面的另一个行,确定了你的数据库的主机。你可能99%都'''更改'''这一行,除非你的网络主机要求你更改。换句话说,你可能将这一行保留为默认的参数值<tt>'localhost'</tt>。 If your database host is different than <tt>'localhost'</tt>, move down to the next line: 如果你的数据库主机与<tt>'localhost'</tt>不同,你可以转移到下一行: define('DB_HOST', 'localhost'); // 99% chance you won't need to change this value 定义('DB_HOST', 'localhost'); //你可能99%都不会更改这个参数值 Delete ''localhost'' and enter in your database host as directed by your web host: 删除''localhost''并且输入你的网络主机控制的数据库主机: define('DB_HOST', 'mysql34.myhostserver'); // 99% chance you won't need to change this value 删除('DB_HOST', 'mysql34.myhostserver'); //你可能99%都不会更改这个参数值 Of course, the '''mysql34.myhostserver''' will be different for you. 当然,'''mysql34.myhostserver'''可能对你来说,有所不同。 ====Possible DB_HOST values==== ====可能的DB_HOST 参数值==== Some possible DB_HOST values for hosting companies: 主机公司的一些可能的DB_HOST参数值: * 1and1 - something similar to <tt>db12345678</tt> * AN Hosting - <tt>localhost</tt> * BlueHost - <tt>localhost</tt> * DreamHost - (the database hostname you created; probably a subdomain like <tt>db.example.com</tt>) * GoDaddy - something similar to <tt>h41mysql52.secureserver.net</tt> * HostGator - <tt>localhost</tt> * HostICan - <tt>localhost</tt> * LaughingSquid - <tt>localhost</tt> * one.com - <tt>localhost</tt> * pair Networks - something similar to <tt>db''nnnx''.pair.com</tt> * Yahoo - <tt>mysql</tt> * Hosts with cPanel - <tt>localhost</tt> * Hosts with Plesk - <tt>localhost</tt> * 1and1 – 与 <tt>db12345678</tt>相似 * AN Hosting - <tt>localhost</tt> * BlueHost - <tt>localhost</tt> * DreamHost - (你创建的数据库主机名; 可能是个子域,像<tt>db.example.com</tt>) * GoDaddy – 与<tt>h41mysql52.secureserver.net</tt>相似 * HostGator - <tt>localhost</tt> * HostICan - <tt>localhost</tt> * LaughingSquid - <tt>localhost</tt> * one.com - <tt>localhost</tt> * pair Networks – 与<tt>db''nnnx''.pair.com</tt>相似 * Yahoo - <tt>mysql</tt> * cPanel主机 - <tt>localhost</tt> * Plesk 主机- <tt>localhost</tt> ====Mysql Alternate Port==== ====Mysql另一个端口==== Also if your database host uses an alternate port number you'll need to change to reflect the alternate port: 同时,如果你的数据库主机使用另一个端口数字,你需要更改,反映这个端口: define('DB_HOST', 'mysql34.myhostserver:3307'); // 99% chance you won't need to change this value 定义('DB_HOST', 'mysql34.myhostserver:3307'); // 你可能99%都不需要更改这个参数值 You'll need to change 3307 to reflect what your host provides you as the alternate port number. 你需要更改3307,反映你的主机向你提供的另一个端口数字。 === Secret keys (2.6) === === Secret keys (2.6) === [[WordPress:Version 2.6]] has 3 secret keys: AUTH_KEY, SECURE_AUTH_KEY, and LOGGED_IN_KEY. [[WordPress:Version 2.6|2.6版本]]拥有3个secret keys: AUTH_KEY, SECURE_AUTH_KEY, and LOGGED_IN_KEY。 You don't have to remember them, so make them long and complicated. Make something up or use [http://api.wordpress.org/secret-key/1.1/ the secret key generator]. 你不需要记住这些keys,因此你可以将这些keys设置地长而复杂。设置这些keys或者使用[http://api.wordpress.org/secret-key/1.1/ the secret key generator]。 Example: 例如: define('AUTH_KEY', ':dr+%/5V4sAUG-gg%aS*v;&xGhd%{YKC^Z7KKGh j>k[.Nf$y7iGKdJ3c*[Kr5Bg'); define('SECURE_AUTH_KEY', 'TufWOuA _.t>#+hA?^|3RfGTm>@*+S=8\"\'+\"}]<m#+}V)p:Qi?jXLq,<h\\`39m_('); define('LOGGED_IN_KEY', 'S~AACm4h1;T^\"qW3_8Zv!Ji=y|)~5i63JI |Al[(<YS<2V^$T])=8Xh2a:b:}U_E'); define('AUTH_KEY', ':dr+%/5V4sAUG-gg%aS*v;&xGhd%{YKC^Z7KKGh j>k[.Nf$y7iGKdJ3c*[Kr5Bg'); define('SECURE_AUTH_KEY', 'TufWOuA _.t>#+hA?^|3RfGTm>@*+S=8\"\'+\"}]<m#+}V)p:Qi?jXLq,<h\\`39m_('); define('LOGGED_IN_KEY', 'S~AACm4h1;T^\"qW3_8Zv!Ji=y|)~5i63JI |Al[(<YS<2V^$T])=8Xh2a:b:}U_E'); define('AUTH_KEY', ':dr+%/5V4sAUG-gg%aS*v;&xGhd%{YKC^Z7KKGh j>k[.Nf$y7iGKdJ3c*[Kr5Bg'); define('SECURE_AUTH_KEY', 'TufWOuA _.t>#+hA?^|3RfGTm>@*+S=8\"\'+\"}]<m#+}V)p:Qi?jXLq,<h\\`39m_('); define('LOGGED_IN_KEY', 'S~AACm4h1;T^\"qW3_8Zv!Ji=y|)~5i63JI |Al[(<YS<2V^$T])=8Xh2a:b:}U_E'); define('AUTH_KEY', ':dr+%/5V4sAUG-gg%aS*v;&xGhd%{YKC^Z7KKGh j>k[.Nf$y7iGKdJ3c*[Kr5Bg'); define('SECURE_AUTH_KEY', 'TufWOuA _.t>#+hA?^|3RfGTm>@*+S=8\"\'+\"}]<m#+}V)p:Qi?jXLq,<h\\`39m_('); define('LOGGED_IN_KEY', 'S~AACm4h1;T^\"qW3_8Zv!Ji=y|)~5i63JI |Al[(<YS<2V^$T])=8Xh2a:b:}U_E'); ===Secret Key (2.5; IMPORTANT)=== ===Secret Key (2.5; 重要)=== '''It is most important to change the default SECRET_KEY value to something other than 'put your unique phrase here'.''' Visit the [http://api.wordpress.org/secret-key/1.0/ WordPress secret key generation site] to get a SECRET_KEY generated for you. '''将默认SECRET_KEY 参数值,更改为其它值,而不是'在这里放上你的唯一的词组',这样做,很重要。''' 访问 [http://api.wordpress.org/secret-key/1.0/ WordPress secret key generation site] 得到为你创建的SECRET_KEY 。 Released with [[WordPress:Version 2.5]], this new, optional entry, called '''SECRET_KEY''', causes better encryption of information stored in the user's cookies. The secret key is a unique phrase. 与[[WordPress:Version 2.5|2.5版本]]一起发行,这个新的,可选择的entry,称为'''SECRET_KEY''',增强用户的cookes中储存的信息的保密性。Secret key是唯一的词组。 <pre> // Change SECRET_KEY to a unique phrase. You won't have to remember it later, // so make it long and complicated. You can visit https://www.grc.com/passwords.htm // to get a phrase generated for you, or just make something up. define('SECRET_KEY', 'put your unique phrase here'); // Change this to a unique phrase. </pre> <pre> // 将 SECRET_KEY更改为唯一的密码。你不用记这个密码, // 因此将这个密码,设置地长而复杂。你可以访问https://www.grc.com/passwords.htm // 选择适合你的密码,或者自己创建一个。 定义('SECRET_KEY', 'put your unique phrase here'); // 将这句话,更改为唯一的密码。</pre> Here's a detailed explanation on the wp-hackers email list from Mark Jaquith in response to the question, "What is the SECRET_KEY for?" 下面是wp-hackers邮件列表上,Mark Jaqith对问题所作的详细的解释," SECRET_KEY 是用来做什么的?" <blockquote> It is a hashing salt that is not readable through the database. "And what is a salt?" A salt is something that adds randomness to a hash input and makes it much harder to crack. For example:<br /> <blockquote> 数据库中的hashing salt 是不可读的。"什么是 salt?" salt是给输入添加随意的内容, hash input ,使得输入内容更加难以破解。例如: <br /> <br /> In these examples, consider that the password is "test", but that the cracker does not know this (indeed, this is what he's trying to determine). And yes, I'm glossing over some stuff, but this is the simplistic explanation.<br /> <br /> <br /> 在这些例子中,假定密码是"测试",但是解密高手并不知道(事实上,这真是他试图破解的内容)。我也的确掩饰了一些内容,但这确实最简单的密码。<br /> <br /> Easy to crack: md5('test');<br /> 容易破解:md5('test');<br /> <br /> Since 'test' is a short dictionary word, crackers who have the output hash can easily use rainbow tables (dictionary lookup table) to crack that password in seconds, or minutes.<br /> <br /> <br /> 因为'test' 是字典上一个简短的单词,输出了hash的解密高手,能够轻易地使用表格 (查找字典表格) 在几秒或者几分钟内,就能够破解这个密码。<br /> <br /> Harder to crack: md5('test' . $known_salt);<br /> 难以破解:md5('test' . $known_salt);<br /> <br /> In this case, the cracker has to generate a new rainbow table that adds the $known_salt value to their table's hashes. This slows them down.<br /> <br /> <br /> 在这个例子中,解密高手需要创建一个新的rainbow表格,将$known_salt参数值添加到这个表格的 hashes。 这样,解密的速度会降低。.<br /> <br /> Even harder to crack: md5('test' . $unknown_salt);<br /> 更加难以破解:md5('test' . $unknown_salt);<br /> <br /> In this case, they don't know the salt. And since a good salt is something very random, like "888a7da62429ba6ad3cb3c76a09641fc" -- they can't use rainbow tables to help them. They have to just "brute force" their way through all the possible combinations. This is a huge hurdle. Something that might take 10 minutes before could now take years. </blockquote> <br /> 在这个例子中,解密高手不知道salt。而且因为好的salt是非常随意的组合,像"888a7da62429ba6ad3cb3c76a09641fc" – 解密高手的表格帮不了他们。他们只有"强迫" 自己尝试所有可能的组合。这种尝试很费功夫。先前可能几分钟就破解了密码,现在可能需要花几年的时间。</blockquote> ===Database character set=== ===数据库字符集=== As of WordPress [[WordPress:Version 2.2|Version 2.2]], '''DB_CHARSET''' was made available to allow designation of the database [[WordPress:Glossary#Character Set|character set]] (e.g. tis620 for TIS620 Thai) to be used when defining the MySQL database tables. The default value of '''utf8''' ([[WordPress:Wikipedia:Unicode|Unicode]] [[WordPress:Wikipedia:UTF-8|UTF-8]]) should NOT BE CHANGED without careful understanding of the outcome. Please note that UTF-8 supports many European languages so leave DB_CHARSET at '''utf8''' and use the appropriate [[WordPress:#Database collation|DB COLLATE]] value for your language. 从 WordPress [[WordPress:Version 2.2|2.2版本]]开始, '''DB_CHARSET''' 就可以用来指定数据库[[WordPress:Glossary#Character Set|字符集]] (例如 tis620代表TIS620 Thai) ,定义MySQL数据库表格时,会使用这些字符集。 '''utf8''' ([[WordPress:Wikipedia:Unicode|Unicode]] [[WordPress:Wikipedia:UTF-8|UTF-8]]) 的默认参数值,再没有慎重考虑输出结果之前,不应该更改。请注意 UTF-8 支持许多欧洲语言,因此将DB_CHARSET保留在'''utf8''' 并且为你的语言,使用适当的[[WordPress:#Database collation|DB COLLATE]] 参数值。 *'''Warning for those performing new installations''': For most Western European languages, including English, there usually should be no reason to change the default value of DB_CHARSET. If your blog needs a different character set, please read [http://dev.mysql.com/doc/refman/5.0/en/charset-charsets.html Character Sets and Collations That MySQL Supports] for the valid values for DB_CHARSET. *'''提醒刚刚开始安装的那些人''':对于大多数欧洲语言,包括英语,通过不需要更改DB_CHARSET的默认参数值。如果你的博客需要不同的字符集,请阅读[http://dev.mysql.com/doc/refman/5.0/en/charset-charsets.html Character Sets and Collations That MySQL Supports]得到DB_CHARSET的有效的参数值。 *'''Warning for those performing upgrades''': If DB_CHARSET and DB_COLLATE do not exist in your <tt>wp-config.php</tt> file, DO NOT add either definition to your <tt>wp-config.php</tt> file unless you read and understand [[WordPress:Converting Database Character Sets]]. Adding DB_CHARSET and DB_COLLATE to the <tt>wp-config.php</tt> file, for an existing blog, can cause problems — as Ryan Boren says, "your queries will go boom!" *'''提醒那些将要升级的人''': 如果你的文件<tt>wp-config.php</tt> 中不存在DB_CHARSET 和DB_COLLATE,不要向你的 DO NOT add either definition to your <tt>wp-config.php</tt> 文件添加任何定义,除非你阅读并且了解[[WordPress:Converting Database Character Sets|转变数据库字符集]]。为当前的博客的 <tt>wp-config.php</tt>文件,添加DB_CHARSET和 DB_COLLATE ,会产生问题 — 就如Ryan Boren所说的, "你的查询会 go boom!" This example shows utf8 which is considered the WordPress default value: 这个例子,显示了考虑WordPress默认参数值的utf8: define('DB_CHARSET', 'utf8'); define('DB_CHARSET', 'utf8'); ===Database collation=== ===数据库整理=== As of WordPress [[WordPress:Version 2.2|Version 2.2]], '''DB_COLLATE''' was made available to allow designation of the database [[WordPress:Glossary#Collation|collation]] (i.e. the sort order of the character set). In most cases, this value should be left blank (null) so the database collation will be automatically assigned by MySQL based on the database character set (i.e. DB_CHARSET). Set '''DB_COLLATE''' to one of the UTF-8 values defined in [http://dev.mysql.com/doc/refman/5.0/en/charset-unicode-sets.html Unicode character sets (utf8 section)] for most Western European languages. 从WordPress[[WordPress:Version 2.2|2.2版本]]开始,可以使用'''DB_COLLATE'''[[WordPress:Glossary#Collation|整理]]数据库(例如,安排字符集的顺序)。在大多数情况下,这个参数值应该保留为空白的(零),这样根据数据库字符集(例如,DB_CHARSET),MySQL会自动地分配整理数据库。将'''DB_COLLATE'''设置为[http://dev.mysql.com/doc/refman/5.0/en/charset-unicode-sets.html 统一字符集 (utf8 部分)]中定义的UTF-8参数值中的一个,用户大多数西欧语言。 *'''Warning for those performing new installations''': There usually should be no reason to change the default value of DB_COLLATE. Leaving the value blank (null) will insure the collation is automatically assigned by MySQL when the database tables are created. *'''提醒那些刚刚开始安装的人''':通常不需要更改DB_COLLATE的默认参数值。将参数值保留为空白(零),创建数据库表格的时候,MySQL能够自动分配整理数据库。 *'''Warning for those performing upgrades''': If DB_COLLATE and DB_CHARSET do not exist in your <tt>wp-config.php</tt> file, DO NOT add either definition to your <tt>wp-config.php</tt> file unless you read and understand [[WordPress:Converting Database Character Sets]]. Adding DB_COLLATE and DB_CHARSET to the <tt>wp-config.php</tt> file, for an existing blog, can cause problems — as Ryan Boren says, "your queries will go boom!" *'''提醒那些开始升级的人''':如果你的<tt>wp-config.php</tt>文件中不存在DB_COLLATE 和DB_CHARSET ,不要向你的文件添加任何定义,除非你阅读并且理解了 [[WordPress:Converting Database Character Sets|转变数据库字符集]]。 为当前的博客, 向<tt>wp-config.php</tt> 文件添加DB_COLLATE and DB_CHARSET ,可能导致问题—就如 Ryan Boren所说的,"你的查询将会 go boom!" <!-- *'''Further warning for those upgrading to WP 2.3.x''': You cannot upgrade from a pre-2.3 version of WordPress with these lines in your wp-config.php file. The upgrade to 2.3.x moves data from the wp_categories table to the wp_terms table, and deletes the former. This cannot happen if the DB_COLLATE and DB_CHARSET lines are included. More info [http://wordpress.org/support/topic/150460 in the forums] and [http://www.webbleyou.com/2008-02-25-wordpress-23x-upgrade-error-tables-wp_terms-and-wp_term_taxonomy-dont-exist/ this blog post]. --> <!-- *'''Further warning for those upgrading to WP 2.3.x''': You cannot upgrade from a pre-2.3 version of WordPress with these lines in your wp-config.php file. The upgrade to 2.3.x moves data from the wp_categories table to the wp_terms table, and deletes the former. This cannot happen if the DB_COLLATE and DB_CHARSET lines are included. More info [http://wordpress.org/support/topic/150460 in the forums] and [http://www.webbleyou.com/2008-02-25-wordpress-23x-upgrade-error-tables-wp_terms-and-wp_term_taxonomy-dont-exist/ this blog post]. --> <!-- *'''特别提醒升级到WP 2.3.x的那些人''': 你的wp-config.php文件中,有这些行,你就不能从2.3之前的版本开始升级。升级到2.3x,将wp_categories 表格中的数据移到wp_terms表格,并且删除先前的表格。如果wp-config.php文件中包含DB_COLLATE 和DB_CHARSET命令行,就不能够执行上述的操作。更多的信息,请看看 [http://wordpress.org/support/topic/150460 论坛] 和[http://www.webbleyou.com/2008-02-25-wordpress-23x-upgrade-error-tables-wp_terms-and-wp_term_taxonomy-dont-exist/ 这个博客文章]。 --> This example is of the WordPress default DB_COLLATE value: 这个例子是关于WordPress默认DB_COLLATE参数值: define('DB_COLLATE', ''); define('DB_COLLATE', ''); *Example if UTF-8 Unicode Turkish collation is needed (DB_CHARSET should be utf8): *例子,如果需要UTF-8 Unicode Turkish collation(DB_CHARSET应该是utf8): define('DB_COLLATE', 'utf8_turkish_ci'); 定义('DB_COLLATE', 'utf8_turkish_ci'); ===$table_prefix=== ===$table_prefix=== The $table_prefix is the value placed in the front of your database tables. Change the value if you want to use something different than '''wp_''' for your database prefix. Typically this is changed if you are [[WordPress:Installing Multiple Blogs|installing multiple WordPress blogs]] in the same database. $table_prefix是放在你的数据库表格开始部分的参数值。如果你想使用另一个数据库前缀,而不是'''wp_''' ,你可以更改这个参数值。一般来说,如果你在同一个数据库中[[WordPress:Installing Multiple Blogs|安装多个WordPress博客]],这个参数值,就会更改。
摘要:
请注意,您对站长百科的所有贡献都可能被其他贡献者编辑,修改或删除。如果您不希望您的文字被任意修改和再散布,请不要提交。
您同时也要向我们保证您所提交的内容是您自己所作,或得自一个不受版权保护或相似自由的来源(参阅
Wordpress-mediawiki:版权
的细节)。
未经许可,请勿提交受版权保护的作品!
取消
编辑帮助
(在新窗口中打开)