title: "服务器环境" post_status: publish comment_status: open taxonomy: category: - hosting-handbook post_tag: - Repos - Data - Docs Translate


服务器环境

尽管 WordPress 几乎能在任何环境中运行,但某些环境在功能和性能方面更为优化。以下是针对 WordPress 高效运行的最低服务器环境配置建议,同时考虑了使用第三方插件和主题的 WordPress 网站,这些插件和主题通常会引入额外的服务器级要求。

WordPress 环境推荐

快速推荐:

所有已发布的兼容性文章可在以下位置查看:

Web Server

Web 服务器是一种软件,它接收并处理来自网站访问者计算机的网络请求,然后将相应的网页数据返回给用户。存在许多不同类型的 Web 服务器软件,它们运行在不同的操作系统上。通常,只要您的 Web 服务器支持并执行 PHP 文件,它就应该能够运行 WordPress。

两种最常见的、也是 WordPress 推荐的 Web 服务器软件是:

已知与 WordPress 兼容良好的、由网络托管公司和开发者使用的其他软件包括:

以上是撰写本文档时(针对 WordPress 6.8)的最新版本。请务必保持您的 Web 服务器为最新版本,以确保最佳性能!

PHP

PHP 是 WordPress 代码所基于的编程语言。该语言在服务器上运行,为了安全性和功能性,保持其更新至关重要。

WordPress 支持许多 PHP 版本,其中一些甚至已过时(参见 PHP 兼容性与 WordPress 版本)。对于托管公司,建议如下:

WordPress 版本

以下是特定 WordPress 版本的详细信息、该版本的 PHP 兼容性以及发布时与 PHP 兼容性相关的开发工单。与 PHP 兼容性相关的工单可随时通过搜索 WordPress Trac 查找。

WordPress 6.8

重要提示:WordPress 6.8 完全兼容 PHP 7.2 (1)、7.3 (1)、7.4 (1)、8.0(1)、8.1 和 8.2,并且 Beta 兼容 PHP 8.3 和 PHP 8.4。 自 2025 年 4 月发布的 WordPress 6.8 起,不再使用“附带例外兼容”这一术语。

“Beta 兼容”或“Beta 支持”是什么意思?

“Beta 兼容”或“Beta 支持”意味着 WordPress 核心正在积极努力实现与该 PHP 版本的完全兼容,但可能仍有一些问题正在解决过程中。以下是概述 PHP 8.3 和 8.4 Beta 支持已知问题的工单。关于 PHP 版本何时从 Beta 转为完全支持 的更多信息,由核心团队记录。

WordPress 6.7

IMPORTANT: WordPress 6.7 is compatible with exceptions with PHP 8.0, PHP 8.1, PHP 8.2, and beta compatible with PHP 8.3, and PHP 8.4.

What does 'compatible with exceptions' mean?

What does "beta" mean?

其他相关工单

WordPress 6.6

重要提示:WordPress 6.6 与 PHP 8.1 和 PHP 8.2 存在例外兼容,与 PHP 8.3 为 Beta 兼容

“存在例外兼容”是什么意思?

“Beta”是什么意思?

WordPress 6.5

重要提示:WordPress 6.5 与 PHP 8.0、PHP 8.1 和 PHP 8.2 存在例外兼容,与 PHP 8.3 为 Beta 兼容

“存在例外兼容”是什么意思?

“Beta”是什么意思?

WordPress 6.4

重要提示:WordPress 6.4 与 PHP 8.0、PHP 8.1 和 PHP 8.2 存在例外兼容,与 PHP 8.3 为 Beta 兼容

“存在例外兼容”是什么意思?

“Beta”是什么意思?

WordPress 6.3

重要提示:WordPress 6.3 与 PHP 8.0 和 PHP 8.1 存在例外兼容,与 PHP 8.2 为 Beta 兼容

“存在例外兼容”是什么意思?

“Beta”是什么意思?

关于 PHP

自 2022 年 11 月 26 日起,PHP 社区仅以 仅安全修复 模式维护 PHP 8.1。将 PHP 保持在最新的稳定版本对于 WordPress 的速度和安全性至关重要。

PHP 社区不再维护 PHP 8.1 之前的版本,尽管它们可能会从操作系统发行版获得安全更新。

已终止支持的 PHP 版本:

PHP 扩展

当可用时,WordPress 核心会利用各种 PHP 扩展。如果缺少首选扩展,WordPress 要么需要做更多工作来完成该模块辅助的任务,要么在最坏情况下,会移除相关功能。

说明:

以下列表假设 PHP 版本 >= 7.2(撰写本文时 WordPress 支持的最低 PHP 版本)。

内置扩展(无需托管操作)

以下扩展是 PHP 自身的组成部分,在支持的 PHP 版本(>= 7.2)中始终启用。无需进行托管配置:

必需扩展

以下列出的 PHP 扩展是 WordPress 网站运行所必需的。

以下列出的 PHP 扩展是强烈推荐的,以便让 WordPress 以最佳状态运行,并最大限度地提高与许多流行插件和主题的兼容性。

The PHP extensions listed below are recommended to allow some WordPress cache (if necessary). APCu, Memcached, and Redis are alternatives of which only one needs to be used.

The PHP extensions listed below are optional to improve some WordPress functionality.

For the sake of completeness, below is a list of the remaining PHP modules WordPress may use in certain situations or if other modules are unavailable. These are fallbacks or optional and not necessarily needed in an optimal environment, but installing them won't hurt.

These extensions are used for file changes, such as updates and plugin/theme installation, when files aren't writeable on the server.

The priority of the transports are Direct file IO, SSH2, FTP PHP Extension, FTP implemented with Sockets, and FTP implemented through PHP alone.

System Packages

数据库

WordPress 使用兼容 MySQL 的系统进行数据存储。

官方推荐版本

以下是 MySQLMariaDB 官方推荐的长时期支持版本。

软件 版本 生命周期终止日期
MySQL 8.4 LTS 2032年4月
MySQL 8.0 LTS 2026年4月
MariaDB 11.8 LTS 2030年6月
MariaDB 11.4 LTS 2029年5月29日
MariaDB 10.11 LTS 2028年2月16日
MariaDB 10.6 LTS 2026年7月6日

End of life MySQL versions

The following versions of MySQL have reached their end of life (EOL) and are no longer supported by the MySQL community. It is highly recommended to upgrade to a supported version for security and performance reasons.

Version Initial GA Release Final Release EOL Date
9.2* January 21, 2025 9.2.0 (January 21, 2025) April 15, 2025
9.1* October 15, 2024 9.1.0 (October 15, 2024) January 21, 2025
9.0* July 1, 2024 9.0.1 (July 23, 2024) October 15, 2024
8.3* January 16, 2024 8.3.0 (January 16, 2024) July 1, 2024
8.2* October 25, 2023 8.2.0 (October 25, 2024) January 16, 2024
8.1* July 18, 2023 8.1.0 (July 18, 2023) October 25, 2023
5.7 October 21, 2015 5.7.44 (October 25, 2023) October 21, 2023
5.6 February 5, 2013 5.6.51 (January 20, 2021) February 5, 2021
5.5 December 3, 2010 5.5.62 (October 22, 2018) December 3, 2018
5.1 November 14, 2008 5.1.73 (December 3, 2013) December 31, 2013
5.0 October 19, 2005 5.0.96 (March 21, 2012) March 21, 2012

End of life MariaDB versions

The following versions of MariaDB have reached their end of life (EOL) and are no longer supported by the MariaDB community. It is highly recommended to upgrade to a supported version for security and performance reasons.

Version Initial GA Release Final Release EOL Date
11.5 August 15, 2024 11.5.2 (August 15, 2024) November 21, 2024
11.3 February 19, 2024 11.3.2 (February 19, 2024) May 16, 2024
11.2 November 21, 2023 11.2.6 (November 4, 2024) November 21, 2024
11.1 August 21, 2023 11.1.6 (August 14, 2024) August 21, 2024
11.0 June 7, 2023 11.0.6 (May 17, 2024) June 6, 2024
10.10 November 17, 2022 10.10.7 (November 14, 2023) November 17, 2023
10.9 August 22, 2022 10.9.8 (August 14, 2023) August 22, 2023
10.8 May 21, 2022 10.8.8 (May 10, 2023) May 20, 2023
10.7 February 14, 2022 10.7.8 (February 6, 2023) February 9, 2023
10.5 June 24, 2020 10.8.8 (May 10, 2023) June 24, 2025
10.4 June 16, 2019 10.4.34 (May 17, 2024) June 18, 2024
10.3 May 25, 2018 10.3.39 (May 10, 2023) May 25, 2023
10.2 May 23, 2017 10.2.44 (May 21, 2022) May 23, 2022
10.1 October 17, 2015 10.1.48 (November 4, 2020) October 17, 2020
10.0 March 31, 2014 10.0.38 (January 31, 2019) March 31, 2019
5.5 April 11, 2012 5.5.68 (May 12, 2020) April 11, 2020
5.3 February 29, 2012 5.3.12 (January 30, 2013) March 1, 2017
5.2 November 10, 2010 5.2.14 (January 30, 2013) November 10, 2015
5.1 February 1, 2010 5.1.67 (January 30, 2013) February 1, 2015

创新版本发布

除了长期支持版本外,MariaDB 和 MySQL 都提供"创新版本"。这些版本的支持周期要短得多(通常最多 2-6 个月),主要面向需要体验最新功能的用户。

从质量和稳定性角度来看,创新版本通常已具备生产就绪状态,可以安全使用。但不建议在生产环境中使用这些版本,原因如下: - 创新版本中包含的任何新功能在未来都可能发生变化。 - 支持周期(包括安全修复)仅限于数月而非数年。

为了发现即将在长期支持版本中引入的新功能可能存在的问题,WordPress 核心会针对当前支持的创新版本进行测试。但该项目并不推荐普通用户使用这些版本。

MySQL Innovation Releases

Version Initial GA Release Final Release EOL Date
9.3* April 15, 2025 July 2025
9.2 January 21, 2025 9.2.0 (January 21, 2025) April 15, 2025
9.1 October 15, 2024 9.1.0 (October 15, 2024) January 21, 2025
9.0 July 1, 2024 9.0.1 (July 23, 2024) October 15, 2024
8.3 January 16, 2024 8.3.0 (January 16, 2024) July 1, 2024
8.2 October 25, 2023 8.2.0 (October 25, 2024) January 16, 2024
8.1 July 18, 2023 8.1.0 (July 18, 2023) October 25, 2023

* Indicates the current innovation release.

MariaDB Innovation/Short-Term Releases

The MariaDB project has decided to retire the concept of innovation releases, replacing them with the concept of "rolling GA releases". This will start with the 12.0 release.

Previously MariaDB referred to these releases as "short-term releases".

Version Release Type Initial GA Release Final Release EOL Date
11.5 Innovation August 15, 2024 11.5.2 (August 15, 2024) November 21, 2024
11.3 Innovation February 19, 2024 11.3.2 (February 19, 2024) May 16, 2024
11.2 Short-term November 21, 2023 11.2.6 (November 4, 2024) November 21, 2024
11.1 Short-term August 21, 2023 11.1.6 (August 14, 2024) August 21, 2024
11.0 Short-term June 7, 2023 11.0.6 (May 17, 2024) June 6, 2024
10.10 Short-term November 17, 2022 10.10.7 (November 14, 2023) November 17, 2023
10.9 Short-term August 22, 2022 10.9.8 (August 14, 2023) August 22, 2023
10.8 Short-term May 21, 2022 10.8.8 (May 10, 2023) May 20, 2023
10.7 Short-term February 14, 2022 10.7.8 (February 6, 2023) February 9, 2023

Other MySQL servers

While WordPress does not regularly test against these MySQL servers, they are known to perform well.

Although WordPress may run on older versions, it is recommended to use these or newer ones for security and performance reasons.

实验性功能:SQLite(功能插件)

注意: WordPress 核心在生产环境中正式支持 MySQL/MariaDB。SQLite 是通过社区 SQLite 数据库集成 功能插件实现的 可选且实验性 功能。请将其视为主机的测试/评估路径,而非全面替代方案。

征求主机反馈 如果您对此功能进行群体试用,请分享:流量概况、缓存情况、写入速率、数据库文件大小、错误日志以及任何插件/主题不兼容情况。如果未来提议合并到核心,这些反馈将非常有用。

如何查看当前版本?

若您使用的是 WordPress 5.2+ 版本,管理后台的 站点健康 功能(位于菜单栏 工具 项下)已内置相关信息查看工具。

若您使用较旧版本,可通过安装名为 Health Check & Troubleshooting 的社区插件来激活 站点健康 功能(更多插件使用帮助)。

[info]若您有意完善本手册,请访问 Github 手册仓库,或在官方 WordPress Slack#hosting 频道留言。[/info]