
WordPress 修复插件
Are you seeing ‘Unable to establish secure connection error’ in WordPress? It is a WordPress 常见错误 and usually occurs when you are trying to install or update a WordPress plugin or theme from official WordPress.org directory. In this article, we will show you why this error occurs and how to easily fix secure connection error in WordPress.
您是否在WordPress中看到“无法建立安全连接错误”? 这是一个WordPress 常见错误 ,通常在您尝试从官方WordPress.org目录安装或更新WordPress插件或主题时发生。 在本文中,我们将向您展示为什么会发生此错误,以及如何轻松修复WordPress中的安全连接错误。

是什么原因导致无法在WordPress中建立安全连接错误? (What Causes Unable to Establish Secure Connection Error in WordPress?)
WordPress comes with a built-in system to 管理更新. This system regularly checks for updates and show notifications for you to install plugin / theme updates.
WordPress带有内置系统来管理更新 。 该系统会定期检查更新,并显示通知您安装插件/主题更新。
However, it needs to connect to the WordPress.org website in order to check for updates or install them. Due to some misconfiguration on your WordPress 托管 server, your website may fail to connect with WordPress.org website.
但是,它需要连接到WordPress.org网站才能检查更新或安装更新。 由于WordPress 托管服务器上的某些配置不正确,您的网站可能无法与WordPress.org网站连接。
这将导致安全连接错误,您将看到如下错误消息:
这将导致安全连接错误,您将看到以下错误消息:
一个意料之外的问题发生了。 WordPress.org 或此服务器的配置可能有问题。如果您仍然遇到问题,请尝试支持论坛。 (WordPress 无法与 WordPress.org 建立安全连接。请联系您的服务器管理员。)位于 /home/username/public_html/wp-admin/includes/update.php 第 122 行
出现了意想不到的问题。 WordPress.org 或该服务器的配置可能有问题。如果您仍然遇到问题,请尝试支持论坛。 (WordPress 无法与 WordPress.org 建立安全连接。请联系您的服务器管理员。)位于 /home/username/public_html/wp-admin/includes/update.php 第 122 行

话虽这么说,让我们看看如何轻松修复 WordPress 中的安全连接错误。
话虽如此,让我们看看如何轻松修复 WordPress 中的安全连接错误。
修复WordPress中的安全连接错误 (Fixing Secure Connection Error in WordPress)
有多种方法可以修复 WordPress 中的意外安全连接错误。您可以根据您的情况尝试以下解决方案之一。
有多种方法可以解决 WordPress 中的意外安全连接错误。您可以根据您的情况尝试以下解决方案之一。
主机和服务器相关问题 (Hosting and Server Related Issues)
If your 共享主机 server is 遭受 DDoS 攻击, then it is likely that the connection to WordPress.org will timeout causing the secure connection error.
如果您的共享主机服务器遭受 DDoS 攻击 ,则与WordPress.org的连接可能会超时,从而导致安全连接错误。
在这种情况下,您可以等待几分钟,然后重试。如果错误仍然存在,那么您需要联系网络托管公司的支持团队。
在这种情况下,您可以等待几分钟,然后重试。如果错误仍然存在,您需要联系网络托管公司的支持团队。
云或 VPS 服务器连接问题
云或 VPS 服务器连接问题
If you are on a cloud or VPS主机, then it is possible that your server is unable to connect to WordPress.org due to some DNS issues.
如果您在云或VPS主机 ,则由于某些DNS问题,您的服务器可能无法连接到WordPress.org。
在这种情况下,您可以将服务器直接指向 WordPress.org 服务器。您需要使用 SSH 连接到您的服务器。
在这种情况下,您可以将服务器直接指向 WordPress.org 服务器。您将需要使用 SSH 连接到服务器。
SSH 是 secure shell 的缩写,它是一种加密协议,允许您使用命令行工具连接到服务器。
SSH 是 Secure Shell 的缩写,是一种加密协议,允许您使用命令行工具连接到服务器。
Windows users can use a tool called 油灰 whereas Mac / Linux users can use the terminal app.
Windows用户可以使用称为油灰的工具,而Mac / Linux用户可以使用终端应用程序。
您将需要具有对您的托管帐户进行 shell 访问的帐户的登录凭据。您可以从托管帐户的 cPanel 仪表板获取此信息或询问您的网络托管服务器提供商。
您将需要该帐户的登录凭据并通过 shell 访问您的托管帐户。您可以从托管帐户的 cPanel 仪表板获取此信息,也可以咨询您的网络托管提供商。
在终端中,您可以像这样连接到服务器:
在终端中,您可以像这样连接到服务器:
ssh username@example.com
不要忘记将 username 替换为您自己的用户名,并将 example.com 替换为您自己的域名。
不要忘记将 username 替换为您自己的用户名,并将 example.com 替换为您自己的域名。
连接后,您需要运行以下命令:
连接后,您需要运行以下命令:
sudo nano /etc/hosts
这将打开一个文件,您需要在文件底部添加以下代码:
这将打开一个文件,您需要在文件底部添加以下代码:
66.155.40.202 api.wordpress.org
您现在可以保存更改并退出编辑器。访问您的网站以查看是否解决了该错误。
您现在可以保存更改并退出编辑器。访问您的网站,看看是否可以解决该错误。
在Localhost上修复WordPress安全连接错误 (Fixing WordPress Secure Connection Error on Localhost)
If you are running 您自己的计算机上的 WordPress (localhost), then you may not have cURL extension enabled for PHP. This extension is required to access WordPress.org for updates.
如果您在您自己的计算机上 (本地主机) 优越的运行WordPress ,则可能未为PHP启用cURL扩展名。 此扩展名是访问WordPress.org进行更新所必需的。
您需要编辑计算机上的 php.ini 文件。该文件通常位于 Mamp、Xampp 或 WAMP 文件夹的 PHP 文件夹中。
您需要编辑计算机上的 php.ini 文件。该文件通常位于 PHP 文件夹的 Mamp、Xampp 或 WAMP 文件夹中。
如果您使用的是 Windows 计算机,请查找以下行:
如果您使用的是 Windows 计算机,请查找以下行:
;extension=php_curl.dll
;extension=php_curl.dll
Mac 和 Linux 用户必须寻找这一行:
Mac 和 Linux 用户必须查找以下行:
;extension=curl.so
;extension=curl.so
现在您需要删除文本前面的分号才能启用扩展。不要忘记保存 php.ini 文件。
现在您需要删除文本前面的分号才能启用扩展。不要忘记保存您的 php.ini 文件。
最后,不要忘记重新启动 Apache 服务器以使更改生效。
最后,不要忘记重新启动 Apache 服务器以使更改生效。
检查防火墙中的开放端口
检查防火墙中开放的端口
如果 cURL 扩展已正确安装在您的本地服务器上,那么下一步就是检查您的互联网连接防火墙。
如果本地服务器上正确安装了 cURL 扩展,则下一步是检查 Internet 连接防火墙。
Your computer’s firewall may be blocking outgoing connections from local server to WordPress.org. If you are on Windows, then press the start button and search for Windows Firewall. Mac users can find firewall settings in 系统偏好设置 » 安全和隐私
您计算机的防火墙可能正在阻止从本地服务器到WordPress.org的传出连接。 如果您使用的是Windows,请按“开始”按钮并搜索Windows防火墙。 Mac用户可以在系统偏好设置 » 安全和隐私找到防火墙设置。
您需要将 Apache 添加到防火墙允许的程序中,并允许传入和传出连接。
您需要将 Apache 添加到防火墙的允许程序中并允许传入和传出连接。

您需要重新启动 Apache 才能使更改生效。
您需要重新启动 Apache 才能使更改生效。
We hope this article helped you solve the WordPress secure connection error. You may also want to see our ultimate step by step WordPress 安全指南 for beginners.
我们希望本文能帮助您解决WordPress安全连接错误。 您可能还想看看我们针对初学者的终极逐步WordPress 安全指南 。
If you liked this article, then please subscribe to our YouTube 频道 for WordPress video tutorials. You can also find us on 推特 and Facebook.
如果您喜欢这篇文章,请订阅我们的YouTube 频道 WordPress视频教程。 您也可以在推特和Facebook上找到我们。
翻译自: https://www.wpbeginner.com/wp-tutorials/how-to-fix-secure-connection-error-in-wordpress/
WordPress 修复插件