如何修复WordPress中的500内部服务器错误

Are you seeing 500 internal server error in WordPress? Internal server error is one of the most common WordPress errors. Since the error doesn’t give any other information, many beginners find it quite frustrating. In this article, we will show you how to easily fix internal server error in WordPress.

您是否在WordPress中看到500个内部服务器错误? 内部服务器错误是最常见的WordPress错误之一。 由于该错误没有提供任何其他信息,因此许多初学者都发现它很令人沮丧。 在本文中,我们将向您展示如何轻松修复WordPress中的内部服务器错误。

How to fix internal server error in WordPress
是什么导致WordPress内部服务器错误? (What Causes Internal Server Error in WordPress?)

Internal server error is not specific to WordPress. It can happen with any website running on a web server. Due to the generic nature of this error, it does not tell the developer anything.

内部服务器错误并非特定于WordPress。 任何在Web服务器上运行的网站都可能发生这种情况。 由于此错误的一般性质,它不会告诉开发人员任何信息。

Asking how to fix an internal server error is like asking your doctor how to fix the pain without telling them where the pain is.

问如何解决内部服务器错误就像问您的医生如何解决痛苦而又不告诉他们痛苦在哪里。

Example of a WordPress website showing internal server error

Internal server error in WordPress is often caused by plugin or theme functions. Other possible causes of internal server error in WordPress that we know of are: corrupted .htaccess file and PHP memory limit.

WordPress中的内部服务器错误通常是由插件或主题功能引起的。 我们知道的WordPress内部服务器错误的其他可能原因是:损坏的.htaccess文件和PHP内存限制。

We have also heard internal server error only showing up when you are trying to access the admin area while the rest of the site works fine.

我们还听到内部服务器错误,仅在您尝试访问管理区域时显示,而该网站的其余部分正常。

That being said, now let’s take a look at how to go about troubleshooting the internal server error in WordPress.

话虽如此,现在让我们看一下如何解决WordPress中的内部服务器错误。

影片教学 (Video Tutorial)

演示地址

If you don’t like the video or need more instructions, then continue reading.

如果您不喜欢该视频或需要更多说明,请继续阅读。

检查损坏的.htaccess文件 (Checking for Corrupt .htaccess File)

The first thing you should do when troubleshooting the internal server error in WordPress is check for the corrupted .htaccess file.

解决WordPress中的内部服务器错误时,您应该做的第一件事是检查损坏的.htaccess文件。

You can do so by renaming your main .htaccess file to something like .htaccess_old. To rename the .htaccess file, you will need to login to your site using FTP or File Manager app in your hosting account’s cPanel dashboard.

您可以通过重命名main来实现。 htaccess文件改为.htaccess_old之类的文件 。 要重命名.htaccess文件,您需要使用托管帐户的cPanel仪表板中的FTP或文件管理器应用程序登录到您的站点。

Once you connected, the .htaccess file will be located in the same directory where you will see folders like wp-content, wp-admin, and wp-includes.

连接后,.htaccess文件将位于同一目录中,在该目录中您将看到wp-content,wp-admin和wp-includes等文件夹。

Editing .htaccess file in WordPress

Once you have renamed the .htaccess file, try visiting your site to see if this solved the problem. If it did, then give yourself a pat on the back because you fixed the internal server error.

重命名.htaccess文件后,请尝试访问您的站点以查看问题是否解决。 如果是这样,请轻拍一下自己的背面,因为您已修复了内部服务器错误。

Before you move on with other things, make sure that you go to Settings » Permalinks page in WordPress admin area and click the save button without making any changes. This will generate a new .htaccess file for you with proper rewrite rules to ensure that your post pages do not return a 404 error.

在继续进行其他操作之前,请确保您转到WordPress管理区域中的“设置”»“永久链接”页面,然后单击“保存”按钮而不进行任何更改。 这将使用正确的重写规则为您生成一个新的.htaccess文件,以确保您的帖子页不返回404错误

If checking for the corrupt .htaccess file solution did not work for you, then you need to continue reading this article.

如果检查损坏的.htaccess文件解决方案对您不起作用,那么您需要继续阅读本文。

增加PHP内存限制 (Increasing the PHP Memory Limit)

Sometimes internal server error can happen if you are exhausting your PHP memory limit. Use our tutorial on how to increase PHP memory limit in WordPress to fix that.

如果您耗尽了PHP内存限制,有时可能会发生内部服务器错误。 使用我们的教程, 了解如何增加WordPress中PHP内存限制以解决此问题。

If you are seeing the internal server error only when you try to login to your WordPress admin or uploading an image in your wp-admin, then you should increase the memory limit by following these steps:

如果仅在尝试登录WordPress管理员或在wp-admin中上载图像时才看到内部服务器错误,则应按照以下步骤增加内存限制:

  1. Create a blank text file called php.ini

    创建一个名为php.ini的空白文本文件
  2. Paste this code in there: memory=64MB

    将此代码粘贴到那里:memory = 64MB
  3. Save the file

    保存文件
  4. Upload it into your /wp-admin/ folder using FTP

    使用FTP将其上传到/ wp-admin /文件夹中

Several users have said that doing the above fixed the admin side problem for them.

几个用户说,执行上述操作为他们解决了管理员方面的问题。

If increasing the memory limit fixed the problem for you, then you have only fixed the problem temporarily. You still need to find the cause that is exhausting your memory limit.

如果增加内存限制为您解决了问题,那么您只是暂时解决了问题。 您仍然需要找到耗尽内存限制的原因。

This could be a poorly coded plugin or even a theme function. We strongly recommend that you ask your WordPress web hosting company to look into the server logs to help you find the exact diagnostics.

这可能是编码不良的插件,甚至是主题函数。 我们强烈建议您请WordPress网络托管公司调查服务器日志,以帮助您找到确切的诊断信息。

If increasing the PHP memory limit did not fix the issue for you, then you are in for some more troubleshooting.

如果增加PHP内存限制不能解决您的问题,那么您将需要进行更多的故障排除。

停用所有插件 (Deactivate all Plugins)

If none of the above solutions worked for you, then this error is most likely being caused by a specific plugin. It is also possible that it is a combination of plugins that are not playing nice with each other.

如果以上解决方案都不适合您,则此错误很可能是由特定插件引起的。 也有可能是插件之间的组合效果不佳。

Sadly, there is no easy way to find this out. You have to deactivate all WordPress plugins at once.

可悲的是,没有简单的方法可以找到答案。 您必须立即停用所有WordPress插件。

Follow the instructions in our guide on how to deactivate all WordPress plugins without WP-Admin.

请按照我们的指南中有关如何在不使用WP-Admin的情况下停用所有WordPress插件的说明进行操作。

Deactivate all WordPress plugins

If disabling all plugins fixed the error, then you know it is one of the plugins that is causing the error.

如果禁用所有插件可以修复该错误,则说明是导致该错误的插件之一。

Simply go to the WordPress admin area and click on ‘Plugins’. Now you need to reactivate one plugin at a time until you find the one that caused the issue. Get rid of that plugin, and report the error to the plugin author.

只需转到WordPress管理区域,然后单击“插件”。 现在,您需要一次重新激活一个插件,直到找到导致问题的插件为止。 摆脱该插件,并将错误报告给插件作者。

重新上传核心文件 (Re-uploading Core Files)

If the plugin option didn’t fix the internal server error, then it is worth re-uploading the wp-admin and wp-includes folder from a fresh WordPress install.

如果插件选项不能解决内部服务器错误,那么值得从全新的WordPress安装中重新上传wp-admin和wp-includes文件夹。

This will NOT remove any of your information, but it may solve the problem in case any file was corrupted.

这不会删除您的任何信息,但是可以解决问题,以防任何文件损坏。

First you will need to visit the WordPress.org website and click on the Download button.

首先,您需要访问WordPress.org网站,然后单击“下载”按钮。

Download WordPress

This will install WordPress zip file to your computer. You need to extract the zip file and inside it you will find a wordpress folder.

这会将WordPress zip文件安装到您的计算机上。 您需要解压缩该zip文件,并在其中找到一个wordpress文件夹。

Next you need to connect to your WordPress website using an FTP client. Once connected go to the root folder of your website. It is the folder that has wp-admin, wp-includes, wp-content folders inside it.

接下来,您需要使用FTP客户端连接到WordPress网站。 连接后,转到网站的根文件夹。 它是其中包含wp-admin,wp-includes和wp-content文件夹的文件夹。

In the left column open the WordPress folder on your computer. Now you need to select wp-includes and wp-admin folders and then right-click and select ‘Upload’.

在左列中,打开计算机上的WordPress文件夹。 现在,您需要选择wp-includes和wp-admin文件夹,然后右键单击并选择“上传”。

Upload fresh WordPress files

Your FTP client will now transfer those folder to your server. It will ask you whether you would like to overwrite the files. Select ‘Overwrite’ and then select ‘Always use this action’.

您的FTP客户端现在会将这些文件夹传输到您的服务器。 它将询问您是否要覆盖文件。 选择“覆盖”,然后选择“始终使用此操作”。

Overwrite files

Your FTP client will now replace your older WordPress files with newer fresh copies. If your WordPress files were corrupted, then this step will fix the internal server error for you.

您的FTP客户端现在将用较新的新副本替换较旧的WordPress文件。 如果您的WordPress文件已损坏,那么此步骤将为您修复内部服务器错误。

询问您的托管服务提供商 (Ask your Hosting Provider)

If all methods fail to fix internal server error on your website, then it is time to get some more help. Contact your web hosting support team and they will be able to check the server logs and locate the root cause of the error.

如果所有方法都不能解决您网站上的内部服务器错误,那么该是时候获得更多帮助了。 请与您的网络托管支持团队联系,他们将能够检查服务器日志并找到错误的根本原因。

If you want to continue troubleshooting on your own, then see our ultimate WordPress troubleshooting guide for beginners.

如果您想自己继续进行故障排除,请参阅针对初学者的终极WordPress故障排除指南。

We hope this article helped you fix the internal server error in WordPress. You may also want to see our complete list of the most common WordPress errors and how to fix them.

我们希望本文能帮助您修复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-the-internal-server-error-in-wordpress/

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值