如何修复暂时无法用于WordPress中的计划维护错误

Are you seeing the ‘Briefly unavailable for scheduled maintenance’ error in WordPress? This error usually appears while updating WordPress core, plugins, or themes.

您是否在WordPress中看到“根本无法进行定期维护”错误? 在更新WordPress核心,插件或主题时,通常会出现此错误。

Basically, your WordPress site fails to finish the update which leaves you stuck in the maintenance mode.

基本上,您的WordPress网站无法完成更新,这使您陷入了维护模式。

In this article, we will show you how to easily fix the “Briefly unavailable for scheduled maintenance” error in WordPress. We will also show you why this error occurs and how you can avoid it in the future.

在本文中,我们将向您展示如何轻松修复WordPress中的“暂时无法进行定期维护”错误。 我们还将向您展示为什么会发生此错误,以及将来如何避免该错误。

Fixing unavailable for scheduled maintenance error in WordPress
为什么会出现WordPress维护模式错误? (Why Does The WordPress Maintenance Mode Error Occur?)

Maintenance mode page is technically not an error. It is a notification page.

从技术上讲,维护模式页面不是错误。 这是一个通知页面。

During the update process, WordPress downloads necessary update files to your server, extract them and then install the update.

在更新过程中,WordPress将必要的更新文件下载到您的服务器,将其解压缩然后安装更新。

WordPress also puts your site on maintenance mode and displays the “Briefly unavailable for scheduled maintenance. Check back in a minute.” notice during the process.

WordPress还将您的网站置于维护模式,并显示“根本无法进行计划的维护。 请稍后再回来查看。” 在此过程中注意。

Unavailable for scheduled maintenance error in WordPress

To trigger the maintenance mode notification, WordPress creates a temporary .maintenance file in your website’s root folder.

为了触发维护模式通知,WordPress在您网站的根文件夹中创建一个临时.maintenance文件。

If everything works normally, then this notice will probably be displayed for only a few seconds. After the successful update, WordPress will automatically delete the maintenance file to disable maintenance mode.

如果一切正常,则此通知可能只会显示几秒钟。 成功更新后,WordPress将自动删除维护文件以禁用维护模式。

However, sometimes due to a slow WordPress hosting server response or low memory issue, the update script will timeout thus interrupting the process. When this happens, WordPress does not get a chance to take your site out of maintenance mode.

但是,有时由于WordPress托管服务器响应缓慢或内存不足问题 ,更新脚本将超时,从而中断该过程。 发生这种情况时,WordPress将没有机会让您的网站退出维护模式。

In other words, your site will continue showing the maintenance mode notice, and you will need to manually fix it.

换句话说,您的站点将继续显示维护模式通知,并且您将需要手动对其进行修复。

如何修复WordPress维护模式错误? (How to Fix WordPress Maintenance Mode Error?)

To get your website out of maintenance mode, all you really need to do is delete the .maintenance file from your site’s root folder using FTP.

要使网站退出维护模式,您真正需要做的就是使用FTP从站点的根文件夹中删除.maintenance文件。

Delete maintenance file

If you can’t find the .maintenance file in your WordPress root directory, then make sure you checked your FTP client to show hidden files.

如果在WordPress根目录中找不到.maintenance文件,请确保已选中FTP客户端以显示隐藏文件。

In Filezilla, you can force it to show hidden files by clicking on Server » Force showing hidden files from the menu bar.

在Filezilla中,您可以通过单击菜单»服务器»强制显示隐藏文件强制其显示隐藏文件

Show hidden files in FTP

Once the .maintenance file is removed, your site will come out of maintenance mode, and the error should be fixed.

删除.maintenance文件后,您的网站将退出维护模式,并且该错误应得到解决。

If you don’t know how to use FTP, then you can also remove the files by going to the file manager in your WordPress hosting control panel, and then deleting the .maintenance file inside the file manager.

如果您不知道如何使用FTP,则还可以通过以下方法删除文件:转到WordPress托管控制面板中的文件管理器,然后删除文件管理器中的.maintenance文件。

将来如何避免WordPress维护模式? (How to Avoid WordPress Maintenance Mode in the Future?)

We already know that the “Briefly unavailable for scheduled maintenance” error is caused by slow server response or low memory issue on your web hosting server.

我们已经知道“暂时无法进行计划的维护”错误是由服务器响应缓慢或Web托管服务器上的内存不足问题引起的。

The easiest way to avoid this error is by upgrading to a higher hosting plan. We recommend going with one of these managed WordPress hosting companies that offer superior hosting performance.

避免此错误的最简单方法是升级到更高的托管计划。 我们建议选择提供卓越托管性能的托管WordPress托管公司之一。

If upgrading to a higher hosting plan is not an option, then we recommend doing plugin and theme updates one at a time.

如果不能升级到更高的托管计划,则建议一次执行一次插件和主题更新。

Often users have a tendency of quickly clicking on the update link underneath each plugin. WordPress then staggers the update order, but even a millisecond of delay in connection could cause a conflict leading your site to be stuck in maintenance mode.

通常,用户倾向于快速单击每个插件下的更新链接。 WordPress随后错开了更新顺序,但是即使延迟一毫秒也可能导致冲突,导致您的网站陷入维护模式。

WordPress Plugin Update One at a Time

Instead of quickly clicking on the Update link, we recommend patiently updating one plugin at a time.

建议您耐心地一次更新一个插件,而不是快速单击“更新”链接。

如何自定义维护模式通知 (How to Customize Maintenance Mode Notification)

An easier solution to avoid showing the default maintenance mode notification is by manually putting your WordPress site on maintenance mode before installing any updates.

避免显示默认维护模式通知的更简单解决方案是在安装任何更新之前,将WordPress网站手动置于维护模式

The best way to do this is by installing and activating the SeedProd plugin. It is the most popular maintenance mode plugin for WordPress. For more details, see our step by step guide on how to install a WordPress plugin.

最好的方法是安装并激活SeedProd插件。 它是WordPress最受欢迎的维护模式插件。 有关更多详细信息,请参阅有关如何安装WordPress插件的分步指南。

Upon activation, go to Settings » Coming Soon Pro page and check the box next to ‘Enable maintenance mode’ option.

激活后,转到“设置”»“即将推出Pro”页面,然后选中“启用维护模式”选项旁边的框。

Enable maintenance mode

After that, you need to click on ‘Edit Coming Soon/Maintenance Page’ button. This will open the SeedProd theme customizer. From here you can choose a theme and then customize it to create a beautiful maintenance mode page for your website.

之后,您需要单击“编辑即将发布的/维护页面”按钮。 这将打开SeedProd主题定制器。 在这里,您可以选择一个主题,然后对其进行自定义,以为您的网站创建一个漂亮的维护模式页面。

Select a theme for your maintenance mode page

Now, if you don’t want to manually put your website in maintenance mode every time you update, then you can create a maintenance page in WordPress without using a plugin.

现在,如果您不想每次更新时都手动将网站置于维护模式,则可以在WordPress中创建维护页面而无需使用插件。

Simply create a new file called maintenance.php on your desktop and paste this code inside it:

只需在桌面上创建一个名为maintenance.php的新文件,并将此代码粘贴到其中:


<?php
$protocol = $_SERVER["SERVER_PROTOCOL"];
if ( 'HTTP/1.1' != $protocol && 'HTTP/1.0' != $protocol )
    $protocol = 'HTTP/1.0';
header( "$protocol 503 Service Unavailable", true, 503 );
header( 'Content-Type: text/html; charset=utf-8' );
?>
<html xmlns="http://www.w3.org/1999/xhtml">
<body>
    <h1>We are updating the site, please check back in 30 minutes.</h1>
</body>
</html>
<?php die(); ?>

Next, you need to upload this file to your WordPress site’s wp-content directory.

接下来,您需要将此文件上传到WordPress网站的wp-content目录。

Now whenever you are updating your website, WordPress will show this page during the maintenance mode. You can use CSS to style this page anyway you want.

现在,无论何时更新网站,WordPress都会在维护模式下显示此页面。 您可以随时使用CSS设置此页面的样式。

Custom maintenance mode notification
对WordPress维护模式错误进行故障排除 (Troubleshooting WordPress Maintenance Mode Error)

Since we have helped thousands of users fix the “Briefly unavailable for scheduled maintenance” error in WordPress, we have helped users solve several unseen issues that can come up.

由于我们已帮助成千上万的用户修复了WordPress中的“暂时无法进行定期维护”错误,因此我们已帮助用户解决了一些可能出现的未见问题。

Below are some additional steps you might have to take if the above solution does not work.

如果上述解决方案不起作用,则下面是您可能必须采取的一些其他步骤。

WordPress still stuck in maintenance mode after the update and fix above?

经过上述更新和修复后,WordPress仍停留在维护模式下吗?

If this is the case, then you need to update the wp-activate.php file located in your main WordPress folder. This is the same place where you found and deleted the .maintenance file.

如果是这种情况,那么您需要更新位于主WordPress文件夹中的wp-activate.php文件。 这是您发现和删除.maintenance文件的相同位置。

You will need to either open the file using your hosting company’s file manager or download it on your computer using FTP.

您将需要使用托管公司的文件管理器打开文件,或者使用FTP将其下载到计算机上。

Next, you need to find the code: define ('WP_INSTALLING', true) and change the true to false.

接下来,您需要找到以下代码: define ('WP_INSTALLING', true)并将true更改为false。

So your code will look like this:

因此,您的代码将如下所示:

define ('WP_INSTALLING', false)

define ('WP_INSTALLING', false)

After that you need to save the changes and upload the file to your hosting server using FTP. If you’re using the hosting company’s file manager, then simply saving the file should get you out of maintenance mode.

之后,您需要保存更改,然后使用FTP将文件上传到托管服务器。 如果您使用托管公司的文件管理器,则只需保存文件即可退出维护模式。

My site is broken after I fixed the WordPress maintenance mode error. How do I fix it?

修复WordPress维护模式错误后,我的网站损坏了。 我如何解决它?

An unfinished or interrupted update may cause issues when your site comes out of maintenance mode.

当站点退出维护模式时,更新未完成或中断可能会导致问题。

If this error occurred when you were updating WordPress core software, then you will need to follow our guide to manually update WordPress using FTP.

如果在更新WordPress核心软件时发生此错误,则需要遵循我们的指南以使用FTP手动更新WordPress

If the error occurred when you were updating a WordPress plugin, then you will need to temporarily deactivate all WordPress plugins using FTP. This step will ensure that the corrupt plugin is disabled, and your website will come back.

如果在更新WordPress插件时发生错误,则需要使用FTP暂时停用所有WordPress插件 。 此步骤将确保已损坏的插件被禁用,并且您的网站将会回来。

Next, you will need to login to your WordPress dashboard and activate one plugin at a time, to see which plugin caused the issue. After that you need to manually install the plugin update, so it’s working properly.

接下来,您将需要登录WordPress仪表板并一次激活一个插件,以查看哪个插件引起了该问题。 之后,您需要手动安装插件更新,因此它可以正常工作。

We hope this article helped you fix ‘Briefly unavailable for scheduled maintenance’ error in WordPress. You may also want to bookmark our ultimate guide on fixing the most common WordPress errors.

我们希望本文能帮助您修复WordPress中的“暂时无法进行定期维护”错误。 您可能还希望将我们的最终指南加入书签,以解决最常见的WordPress错误

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

如果您喜欢这篇文章,请订阅我们的YouTube频道 WordPress视频教程。 您也可以在TwitterFacebook上找到我们。

翻译自: https://www.wpbeginner.com/wp-tutorials/how-to-fix-briefly-unavailable-for-scheduled-maintenance-error-in-wordpress/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值