惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

L
LINUX DO - 热门话题
Stack Overflow Blog
Stack Overflow Blog
B
Blog
WordPress大学
WordPress大学
Project Zero
Project Zero
P
Palo Alto Networks Blog
阮一峰的网络日志
阮一峰的网络日志
博客园 - 司徒正美
有赞技术团队
有赞技术团队
S
SegmentFault 最新的问题
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
小众软件
小众软件
T
Tailwind CSS Blog
Forbes - Security
Forbes - Security
F
Full Disclosure
SecWiki News
SecWiki News
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Hacker News: Ask HN
Hacker News: Ask HN
C
Check Point Blog
Microsoft Security Blog
Microsoft Security Blog
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
F
Fortinet All Blogs
Cisco Talos Blog
Cisco Talos Blog
G
Google Developers Blog
J
Java Code Geeks
Google DeepMind News
Google DeepMind News
人人都是产品经理
人人都是产品经理
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
Recorded Future
Recorded Future
O
OpenAI News
Spread Privacy
Spread Privacy
MongoDB | Blog
MongoDB | Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
C
Cybersecurity and Infrastructure Security Agency CISA
S
Securelist
V
Vulnerabilities – Threatpost
Y
Y Combinator Blog
IT之家
IT之家
U
Unit 42
腾讯CDC
S
Security Affairs
C
Cisco Blogs
Schneier on Security
Schneier on Security
The Last Watchdog
The Last Watchdog
B
Blog RSS Feed
宝玉的分享
宝玉的分享
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
S
Security @ Cisco Blogs
Cyberwarzone
Cyberwarzone
T
The Blog of Author Tim Ferriss

Meks

How Adding Slack Bot Boosted Our Culture of Appreciation 10 Best Knowledge Base & Wiki WordPress Themes 2021 How to use (and why) WordPress sitemap plugin 22 free and premium podcast software for your show [2021 edition] Digital storytelling with WordPress – an all-in-one guide to make your web stories pop! How to use WordPress autoposting plugin to improve your visibility and SEO? How to create a personal branding site? Step-by-step DIY guide Top 15 WordPress content plugins and tools to improve your visibility and rankings WCEU 2020 recap – key takeaways from the biggest online WordPress conference
How to increase WordPress Memory Limit (quick fixes)
Dusan Milovanovic · 2021-06-16 · via Meks

Here is a post about how to increase the memory limit in WordPress. Allowed memory size exhausted error message showed up in your WordPress installation? No worries – this is one of the most common errors in WordPress. You can apply an easy fix by increasing the memory limit in your PHP.

Table of Contents

  1. A quick introduction to WordPress memory errors
  2. Checking the WordPress memory limit
  3. Edit your wp-config.php file
  4. Edit your PHP.ini file
  5. Edit your .htaccess file

A quick introduction to WordPress memory errors

WordPress is one of the most stable platforms today, and most of the problems you can encounter are not so difficult to fix. Memory limit error is also known as ‘PHP memory limit error, and if it happens in your WordPress installation, it will look like this.

fatal error: allowed memory size of 67108864 bytes exhausted

This error happens in different circumstances, but the most common are:

  • When you try to install a new theme or a plugin
  • When you try to upload images or other media to your website

Your hosting provides this memory. When you buy your hosting plan, your site will get a specific amount of resources. As your site grows, you start using more complex plugins and scripts – you may hit your memory limit. Again, speaking WordPress – if you see this error, you won’t complete the action that you wanted to take.

Top WP Hosting recommended by Meks

Checking the WordPress memory limit

WordPress 5.2 introduced a pretty handy tool called “Site Health.” It is located in the WordPress dashboard’s Tools / Site Health section. To see the memory limit of your website, go to Tools / Site Health / Info and go to the Server section.

checking wordpress memory limit

This means that your server has a 128MB memory limit. If there is a memory limit error on your website, make sure that you increase this number. We will show several most efficient ways to do this.

If you are not 100% sure about what you are doing, please contact your hosting provider and ask them to increase your PHP memory limit for you.

Edit your wp-config.php file

Before editing the wp-config.php file, make sure that there is a backup of this file. Look for the “WP_MEMORY_LIMIT ” text inside wp-config. If you don’t find the WP_MEMORY_LIMIT line inside the wp-config.php file, you can paste it right before the part that says: “That’s all, stop editing! Happy publishing.”

define('WP_MEMORY_LIMIT', '256M');

If you still get the error, open the wp-config file, increase the memory limit further, re-upload the file, and see what will happen next.

Follow this link to find more info about the wp-config.php file.

Edit your PHP.ini file

If your hosting allows access to the PHP.ini file, edit it and increase the maximum amount of memory a script may consume (in this case, this is 128MB)

memory_limit = 256M ; Maximum amount of memory a script may consume (128MB)

Edit your .htaccess file

If your host doesn’t allow access to the PHP.ini file, there is a quick but not so recommended method of modifying your .htaccess file. Before editing, please make sure that you have a backup of this file, too. Add the following code to your .htaccess file.

php_value memory_limit 256M

Final thoughts

If the methods above don’t work or aren’t successful, make sure to talk to your hosting about your hosting problems and increase your memory limit. Maybe it’s the right time to test their support skills.

Got questions or like to talk? Please subscribe to our YouTube Channel for more WordPress tutorials. You can also find us on Twitter and Facebook.

Tags: , ,