把 WordPress 搬到另一台服务器,通常不需要重新安装;真正需要厘清的是哪些东西变了:服务器、数据库连接、域名、目录,还是网络内各子站点的地址。不同变化会影响不同配置,简单替换数据库中所有旧域名既可能破坏序列化数据,也可能错误修改文章 GUID。
本文按 WordPress《Migrating WordPress》完整内容编译并重组。源页标示 2025-07-07 更新,但包含更早的界面名称、主题路径、路由器设置和迁移办法。本稿于 2026-10-05 核对全文,并用官方 WP-CLI 与多站点域名映射文档纠正明确过时或相互矛盾的部分。所有命令只经静态审查,没有连接、迁移或改写任何 WordPress 站点。

一、先理解 home 和 siteurl
单站点“设置 → 常规”中的两项地址有不同职责:
- 站点地址(Site Address)对应
home,是希望访客在浏览器输入的公开地址。 - WordPress 地址(WordPress Address)对应
siteurl,是 WordPress 核心文件所在地址。
两者都应包含正确协议,原文使用 https://,末尾不加斜杠。如果核心文件放在子目录而站点从域名根目录访问,两者可能不同,不能机械地设成一样。把地址改错会让登录和前台异常;仅修复地址时,不需要把本文全部迁站步骤都做一遍。
本节的简单地址修复针对单站点。Multisite 还有网络级和各子站点表中的引用,不能只改两个选项就认为迁移完成。
二、四种地址修复办法,各自有边界
在 wp-config.php 中覆盖地址
define( 'WP_HOME', 'https://example.com' );
define( 'WP_SITEURL', 'https://example.com' );
这能固定运行时使用的地址,但并不是把数据库内所有 URL 都修好了;在常规设置页面中也不能再自由编辑这两个被常量覆盖的值。实际值应按公开地址与核心目录分别填写,并检查已有常量,避免重复定义。
临时使用主题 functions.php
原文介绍在无法正常进入后台、仍能管理站点文件时,备份当前主题的 functions.php,在开头 PHP 标签之后暂时加入:
update_option( 'siteurl', 'https://example.com' );
update_option( 'home', 'https://example.com' );
访问登录或管理页面,让选项写回后,必须立即移除这两行。它们长期存在会反复写地址,并且可能随主题切换而失效。若创建了仅为修复而存在的文件,修复后也要按备份记录清理;不要给已经有 PHP 开始标签的文件重复添加标签。
原文末尾还提到直接修改 wp-login.php,在加载 wp-load.php 之后加入相同的 update_option()。这是历史紧急修复方法,会改动核心文件、受升级覆盖,也可能留下持续写入逻辑。本稿保留其用途说明,但优先选择可审计的配置、数据库选项或下文 WP-CLI 方法,修复后检查核心文件是否已恢复。
RELOCATE 自动定位
源文的另一种临时办法是在 wp-config.php 中设置 define( 'RELOCATE', true );,然后直接访问新服务器的 wp-login.php。相关逻辑会根据登录请求中的主机与路径更新 siteurl,帮助后台重新可达。
风险必须保留:它不会修复站点其余所有地址;更不能长期启用。在某些配置下,攻击者能够通过不可信请求信息影响站点地址。修复完成后应删除这行,而不是把它当成正常运行选项。本稿未执行或复制源文内部实现为新的应用代码。
直接修改数据库选项
先备份数据库并把副本保存在站点之外,再用主机提供的数据库管理工具定位实际 WordPress 数据库。在实际前缀的 options 表中,分别找到 option_name=siteurl 和 option_name=home,只改这两条记录的 option_value。默认前缀是 wp_,但并非所有站点都如此。
若有受控 WP-CLI 环境,原文也给出了等价的选项更新命令:
wp option update home 'https://example.com'
wp option update siteurl 'https://example.com'
这些命令会写数据库,应先确认当前目录或 --path 指向正确安装,且 wp-config.php 连接的是迁移副本而非生产库。只修两个选项不会改掉文章、组件或插件设置中的其他链接。
三、局域网站点对外开放不只是修改 URL
源文用 Twenty Eleven 主题路径、带端口的 URL 和旧 pfSense 菜单举例:先临时修正地址,再配置 WAN 端口转发、对应防火墙规则及 NAT reflection,使内外网络都能访问。其核心提醒是“地址”和“网络可达性”是两回事。
本稿不把这套历史菜单和“等待十分钟”的经验当作当前通用步骤。应分别核对 DNS、反向代理、证书、监听端口、防火墙和内网访问路径。只有明确需要公开的 Web 服务才开放到外部;不要顺手开放数据库或管理端口。原文的 https://域名:端口 还需要相应 TLS 配置,URL 写成 HTTPS 并不会自动产生证书。
四、换服务器但保留域名和 URL
迁移前需要完整保存 WordPress 目录、媒体、主题、插件和数据库。文件备份与数据库备份必须对应同一合理时间点,否则迁移期间新增的文章、订单或上传可能丢失。写入冻结、最终增量同步和切换窗口属于实际站点计划,需要按业务确定。
如果域名、路径和数据库连接信息都不变,主要工作是把文件与数据库复制到新服务器。数据库名称、用户名、密码或主机改变时,更新新站的 wp-config.php。数据库凭证是秘密,不能放在公开目录、下载链接或迁移日志里。
原文为切换前测试提出暂改数据库里的 home、siteurl,并在上线时重新处理固定链接。若采用该办法,必须完整记录临时值并恢复;也可在受控测试环境用适当的域名解析方案保持正式 URL,但仍要核对证书、Cookie 和代理设置。这是本稿的运维补充,不是已执行的验证。
五、换域名或 URL:保留原备份,再修改迁移副本
源文的顺序是:下载原站文件并导出数据库,保存一份不动的备份;在旧站常规设置中把地址改成新地址,保存后可能立即出现 404;再次下载文件和导出数据库;修改新服务器连接参数,上传文件并导入数据库。
这套办法会让旧站在切换前就开始使用新地址。本稿改编:在能独立准备新站的场景,优先对迁移副本修改地址与内容,在核验后再切流量,原站与原始备份保持可回退。若按原文在旧站直接改地址,必须把短暂不可用和两次导出之间的写入纳入维护计划。
文件和数据库移动完成后,数据库中仍可能残留旧域名。尤其是主题、组件和插件把数据保存为 PHP 序列化字符串时,普通文本替换只改 URL、不更新编码里的字符串长度,可能使整个值无法正确读取。
用理解序列化数据的替换工具
源文列举 Better Search Replace、Velvet Blues Update URLs、WP-CLI 和 Interconnectit 的数据库替换脚本。这些名称是原文的工具选项,不代表本稿核验了它们在当前版本下的维护或安全状态。网页数据库替换脚本若留在可访问路径中,会产生额外风险;使用前审查来源、访问控制和清理计划。
WP-CLI 官方 search-replace 文档明确支持处理 PHP 序列化数据。默认只处理 $wpdb 注册的表;Multisite 默认也只针对当前站点,--network 才扩展到注册的网络表。下面是本稿增加的预演形式:
wp --path='/srv/www/newsite' search-replace \
'https://old.example.com' 'https://new.example.com' \
--skip-columns=guid --dry-run
/srv/www/newsite 和两个域名均为示例,执行前必须核对真实目标。--dry-run 报告替换结果而不保存替换;本任务连预演命令也没有运行。预演并不证明所有历史 URL 变体、插件自建表或媒体路径都已覆盖;应审阅所选表及变更数,然后才在已验证副本上决定执行写入版。
移除 --dry-run 会真正改写数据库。不要为了“全扫一遍”直接使用 --all-tables:共享数据库中可能还有其他站点或应用。插件表需按实际前缀和归属选择,不应只凭字符串相似性扩大范围。
原文矛盾处的修正:迁站页一处写“只在 wp_posts 做替换”,但其他段落又要求检查 options、插件数据和多站点表。本文不把这句话当作完整迁站规则;它只能限定某个有意缩小范围的操作,真实迁移必须按数据含义选择所有相关表,并使用支持序列化的工具。
不要把 GUID 当作待更新链接
wp_posts.guid 是文章的全局标识,主要用于订阅源识别已读条目。它常常长得像旧域名下的 URL,但作用是“这篇文章是谁”,不是“现在在哪里访问”。迁域名时改它,可能让订阅阅读器把旧文章当成新文章重新显示。
因此迁站替换应跳过 guid,这正是示例中 --skip-columns=guid 的作用。文章正文和媒体链接应在对应内容字段中更新,而不是借修改 GUID 修理图片。
六、数据库之外的地址与配置也要检查
模板文件中的手写链接,例如 sidebar.php、footer.php 中的旧域名,需要单独修正;通过 bloginfo() 等模板函数从配置生成的地址通常不需要手工替换。
数据库连接改变时,备份并修改 wp-config.php 中相关主机、库名和账户参数。迁表前缀是另一类变化,除了真实表名和配置,还会影响用户权限元数据的键。原文给出下面的广泛替换:
-- 原文历史示例:会改写整张目标表中的匹配键,不应未经检查直接执行。
UPDATE `newprefix_usermeta`
SET `meta_key` = REPLACE(`meta_key`, 'oldprefix_', 'newprefix_');
这条 SQL 没有 WHERE 限制,对表内所有行计算替换,也会替换键中任何匹配子串。必须先核对实际权限键、表归属和备份;它不是修改全站前缀的完整脚本,更不宜把不可信输入拼接成标识符或替换参数。
对 Apache 站点,修改地址后应先备份 .htaccess,保存自定义重写和重定向,再通过固定链接设置重新生成 WordPress 所需规则,最后合并自定义部分并验证。Nginx 等服务器不使用 .htaccess,要检查实际 Web 服务器配置,不能照搬文件步骤。
此外还要检查文章中的图片链接、上传路径、插件选项、组件、菜单、站点地图和统计设置。dashboard_incoming_links 是原文列出的旧选项,自 WordPress 3.8 起已不再使用;发现其中旧地址,不应与活跃配置混为一谈。
原文展示用 SQL REPLACE(post_content, ...) 更改上传目录的做法。它只适合已经确认字段内容与替换范围的情形,不适用于整个数据库或序列化值;本文把支持序列化、限定范围的替换作为主流程,保留这一历史方法的作用边界。
七、在同一服务器内移动目录
如果只是把核心文件放入独立子目录、但仍从域名根路径提供站点,应按官方“Giving WordPress Its Own Directory”方案处理,这与把整个站点 URL 移入子目录不同。
- 创建目标目录;若移到根目录,先保存原有
index.php、.htaccess和可能冲突的文件。 - 按原文的原地移动流程,先在常规设置中填写核心文件的新地址与访客的新地址,保存后暂时不要用前台检查是否成功。
- 移动完整核心目录内容及所有子目录,不遗漏媒体、主题和插件。
- 通过新位置的
wp-admin或wp-login.php登录,更新固定链接规则。 - 修正旧媒体地址和菜单链接,检查文件权限、缓存以及实际服务器所需重载。
原文提醒某些主机迁移后可能出现 0000 权限,并举出将普通文件恢复为 0644 的例子。这不能推导为所有文件和目录一律设成 0644;目录和敏感配置有不同要求,应按实际所有权、服务用户和最小权限核验。
若忘记先改 URL,可以直接修正数据库选项。原文也提供将旧目录路径临时符号链接到新目录的方法:
ln -s /path/to/new /path/to/old
这个命令只有在旧路径不存在、目标与 Web 服务器符号链接规则均明确时才适用;Windows 的符号链接也不能简单等同于普通快捷方式。使用后核对跳转与文件访问,并按计划移除临时链接。
迁移副本中的 transient 缓存可能还保留旧地址。原文给出按 option_name LIKE '%\_transient\_%' 删除记录的 SQL,这会删除匹配的临时值,并不修复持久配置,且表前缀、数据库模式和对象缓存后端都影响处理范围。本稿没有运行这一删除操作;应只针对确认可重建的缓存和迁移副本处理,保留数据库备份。
八、旧站关闭还是继续运行
若旧站关闭,源文建议保存原文件和数据库,修改地址后导出迁移用副本,再上传到新服务器。实际收尾还应确定旧域名到新地址的重定向、证书、DNS、生效窗口和原站写入状态,避免两个站点各自产生新内容。
若旧站也要继续运行,源文把流程拆成“激活新站”和“恢复旧站”:先保存未改地址的旧副本,再制作带新地址的新副本,最后恢复旧数据。其历史步骤包含删除旧站数据库、覆盖目录后重新导入。这些操作可能直接摧毁旧站数据,本稿不将其作为默认操作顺序,更没有执行它们。建议将两份站点配置与数据库独立准备,逐一验证,避免以删除旧库为复制站点的前提。
原文还介绍另一种“内容迁移”:新装 WordPress,从旧站导出 WXR,在新站导入并映射作者。它会增加内容,通常不会删除新站已有的“Hello World”等文章;但它不是文件、插件、主题、完整账户和设置的克隆。迁移目标如果是复制整站,不能只做 WXR 导入就宣称完成。
九、Multisite 迁移要检查网络与每个子站点
同域名、同路径地换服务器,可在一致性备份基础上迁移文件和数据库,并核对配置。若域名或目录也改变,就要查看网络级表和各子站点表,而不能仅更新主站的两个选项。
- 核对
wp_site与wp_blogs中的域名、路径和各站点记录;目录变化时尤其关注wp_blogs。 - 检查各站点
wp_x_options中实际存在的home、siteurl,以及旧部署可能使用的fileupload_url。 - 网络根路径变化时核对
wp-config.php和 Web 重写规则;子域模式与子目录模式互换时,核对SUBDOMAIN_INSTALL及完整网络设置。 - 对涉及序列化的数据使用合适工具,仍跳过文章 GUID,逐站验证登录、媒体和链接。
源文称这一步“不容易自动化”,同时强调不能对全库盲目替换。当前 WP-CLI 已有网络范围选项,但工具不能替代对域名映射、特殊插件表和历史路径语义的判断。即使使用 --network,也要确认目标网络和表范围,不应把“工具可遍历”当成“所有替换都正确”。
十、把多个独立博客并入一个 Multisite
源文以 cPanel 为背景,依次介绍整站备份、每站导出 WXR、新建 WordPress 网络、为每站建立子站点、导入内容和作者、恢复组件与设置,以及切换域名。这里整理为一条完整检查顺序:
- 先做每个原站的整站备份,另外保存主题与插件文件、设置记录以及域名和邮件转发配置。
- 从每个站点的“工具 → 导出”得到 WXR。检查导出文件能解析、内容数量与目标范围一致;原文建议检查末尾是否有最近文章,但这一检查不足以证明全部内容无遗漏。
- 若插件干扰导出,应在受控维护或测试环境排查;不能为了导出就不评估业务影响地停用生产全部插件。原文为减少体积建议删除隔离垃圾评论,这是另一个删除动作,应按保留需求决定,不能默认执行。
- 建立正常工作的 Multisite,为每个原站创建目标子站点,规划好临时地址和最终域名。名称变化可能影响管理跳转,应先决定再导入。
- 在各子站点导入其 WXR,映射到正确作者或创建所需作者,按需要选择下载附件;之后核对附件是否到达正确位置并能在正文显示。
- 恢复主题、插件、组件和站点选项。WXR 不包含全部组件配置和插件设置,导入生成的作者也不等于完整迁移用户角色与附加元数据。
- 最后安排 DNS、虚拟主机、证书和域名映射,并逐站验证。原站域名和邮件转发不得因控制面板删除或改建域名而意外消失。
过时限制修正:源文这一节要求“必须选择子域而非子目录”。官方多站点域名映射文档明确说明,子域和子目录子站都能映射到独立域名,且 WordPress 4.5 起已原生支持域名映射。因此本文不保留那条历史限制;应按实际网络设计与当前安装条件选型。
导入还受 PHP 上传、请求体和内存设置限制。源文写的 max_upload_size 不是标准 PHP 配置项;应核对实际生效的 upload_max_filesize、post_max_size、memory_limit 及 Web 层限制。原文举的 10MB/128MB 只是旧例,不能保证足够;“把 php.ini 放进 wp-admin 和 wp-includes”也依赖主机运行方式,不是通用解法。
若遗漏设置,最可靠的证据是事先保存的文件、数据库和配置记录。源文建议利用搜索引擎缓存页面或 Internet Archive 回看;前者不应被视作始终存在的功能,后者即使有归档也未必含全部资源,更不能恢复私有配置和用户数据。
十一、以验证结果决定是否切换
至少核对前台主要页面、后台登录、角色权限、媒体附件、永久链接、菜单和重定向;有业务插件时,还要验证其数据与流程。检查正式 URL、证书、缓存和外部集成,确认没有循环跳转或指回旧环境的写入路径。保留可恢复备份,并在切换后观察访问与错误日志。本文只提供核验范围,没有伪造成功迁站或恢复结果。
来源、署名与许可
主要来源:WordPress Advanced Administration Handbook — Migrating WordPress,作者为 WordPress 文档贡献团队。手册仓库由 WordPress Hosting Team 与 Documentation Team 协作,采用 GNU GPL 第 2 版。原文、许可证与补充核验页面随稿归档;本中文改编同样保留 GPL-2.0 许可与无担保说明。
未完纪于 2026-10-05 完成中文编译、内容重组和明确标注的技术修正。正文中的 PHP、SQL、Shell 代码均已 HTML 转义;未执行破坏性命令。静态审查未发现的问题不代表不存在漏洞,真实迁移仍需环境适配与恢复演练。
保留的完整许可声明
以下为原项目适用许可文本,原作者与文档归属及本文改动说明见正文。
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Lesser General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License.












暂无评论内容