wordpress吃内存
Are you seeing an allowed memory size exhausted error in WordPress? This is one of the most common WordPress errors, and you can easily fix it by increasing the php memory limit in WordPress. In this article, we will show you how to fix WordPress memory exhausted error by increasing PHP memory.
您是否在WordPress中看到允许的内存大小耗尽错误? 这是最常见的WordPress错误之一 ,您可以通过增加WordPress中的php内存限制来轻松修复它。 在本文中,我们将向您展示如何通过增加PHP内存来修复WordPress内存耗尽错误。
什么是WordPress内存耗尽错误? (What is WordPress Memory Exhausted Error?)
WordPress is written in PHP, which is a server-side programming language. Every website needs a WordPress hosting server for it to function properly.
WordPress用PHP编写, PHP是一种服务器端编程语言。 每个网站都需要一个WordPress托管服务器才能正常运行。
Web servers are just like any other computer. They need memory to efficiently run multiple applications at the same time. Server administrators allocate specific memory size to different applications including PHP.
Web服务器就像其他任何计算机一样。 他们需要内存才能有效地同时运行多个应用程序。 服务器管理员将特定的内存大小分配给包括PHP在内的不同应用程序。
When your WordPress code requires more memory than the default allocated memory, you get to see this error.
当您的WordPress代码比默认分配的内存需要更多的内存时,您会看到此错误。
Fatal error: Allowed memory size of 33554432 bytes exhausted (tried to allocate 2348617 bytes) in /home4/xxx/public_html/wp-includes/plugin.php on line xxx
By default, WordPress automatically tries to increase PHP memory limit if it is less than 64MB. However, 64MB is often not high enough.
默认情况下,如果小于64MB,WordPress会自动尝试增加PHP内存限制。 但是,64MB通常不够高。
Having said that, let’s see how to easily increase PHP memory limit in WordPress to avoid memory exhausted error.
话虽如此,让我们看看如何轻松地增加WordPress中PHP内存限制,以避免内存耗尽错误。
增加WordPress中PHP内存限制 (Increase PHP Memory Limit in WordPress)
First you need to edit the wp-config.php file on your WordPress site. It is located in your WordPress site’s root folder, and you will need to use an FTP client or file manager in your web hosting control panel.
首先,您需要在WordPress网站上编辑wp-config.php文件 。 它位于WordPress网站的根文件夹中,您将需要在虚拟主机控制面板中使用FTP客户端或文件管理器。
Next, you need to paste this code in wp-config.php file just before the line that says ‘That’s all, stop editing! Happy blogging.’
接下来,您需要将此代码粘贴到wp-config.php文件中,紧接着说“就是了,停止编辑! 祝您博客愉快。”
define( 'WP_MEMORY_LIMIT', '256M' );
This code tells WordPress to increase the PHP memory limit to 256MB.
此代码告诉WordPress将PHP内存限制增加到256MB。
Once you are done, you need to save your changes and upload your wp-config.php file back to your server.
完成后,您需要保存所做的更改并将wp-config.php文件上传回服务器。
You can now visit your WordPress site and memory exhausted error should disappear now.
您现在可以访问WordPress网站,并且内存耗尽错误现在应该消失了。
If you are new to WordPress, then take a look at our beginners guide on how to copy and paste code from the web.
如果您不熟悉WordPress,请查看我们的初学者指南, 了解如何从Web复制和粘贴代码 。
We also have a step by step guide on how to find and edit wp-config.php file.
我们还提供了有关如何查找和编辑wp-config.php文件的分步指南。
Note: If this solution does not work for you, then this means your web hosting service provider does not allow WordPress to increase PHP memory limit. You will need to ask your web hosting provider to increase your PHP memory limit manually.
注意:如果此解决方案不适合您,则意味着您的网络托管服务提供商不允许WordPress增加PHP内存限制。 您将需要让您的虚拟主机提供商手动增加您PHP内存限制。
That’s all we hope this article helped you solve WordPress memory exhausted error by increasing PHP memory limit. You may also want to see our step-by-step beginner’s guide to troubleshooting WordPress errors.
这就是我们希望本文通过增加PHP内存限制来帮助您解决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视频教程。 您也可以在Twitter和Facebook上找到我们。
翻译自: https://www.wpbeginner.com/wp-tutorials/fix-wordpress-memory-exhausted-error-increase-php-memory/
wordpress吃内存