admin管理员组文章数量:1406177
I'm using WordPress for a personal website. A couple of days ago, I made some basic HTML and CSS changes to one of my pages (such as changing margins and an H3 into an H2), but now, every time I access that page, I get this error (which I only see on this page, none of the others have any issues).
Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 62914592 bytes) in /www/volleyballandme_311/public/wp-includes/class-wpdb.php on line 1812
I've tried accessing the wp-config.php
file and adding define('WP_MEMORY_LIMIT', '512M');
but the error persists. I've also run WP Sweep to clean unused and unnecessary files, but the error persists.
What are some other things I can do in order to fix this error and visualize the content? Thanks for your help!
I'm using WordPress for a personal website. A couple of days ago, I made some basic HTML and CSS changes to one of my pages (such as changing margins and an H3 into an H2), but now, every time I access that page, I get this error (which I only see on this page, none of the others have any issues).
Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 62914592 bytes) in /www/volleyballandme_311/public/wp-includes/class-wpdb.php on line 1812
I've tried accessing the wp-config.php
file and adding define('WP_MEMORY_LIMIT', '512M');
but the error persists. I've also run WP Sweep to clean unused and unnecessary files, but the error persists.
What are some other things I can do in order to fix this error and visualize the content? Thanks for your help!
Share Improve this question asked Mar 6 at 14:59 Danilo.MicucciDanilo.Micucci 819 bronze badges 6 | Show 1 more comment1 Answer
Reset to default 0There are two hints in the error message that are worth pursuing the investigation:
- "tried to allocate 62914592 bytes"
it's not some random string concatenation that, willing to reserve 10 bytes, gets the bad luck of being the one that makes total memory consumption exceed the limit after ten other million concatenations did the same;
here it's something trying to get a 62 MB memory block at once: an image processor loading a big photo in memory, an unzip of a 10 MB file, a dump of a database… - "class-wpdb.php on line 1812"
Well, with such a name, it looks like the culprit is something reading a big chunk from a database.
With that all, the first thing you have to do is go look at line 1812 of the file /www/volleyballandme_311/public/wp-includes/class-wpdb.php
. We can't do it for you (even if we knew your WordPress version this would be complicated to find the exact same as you).
If, as assumed, this crashes in a function reading the results of an SQL query, find which query (a quick way would be to add a file_put_contents('/tmp/queries.sql', $theVariableHoldingTheQuery."\n", FILE_APPEND);
before what looks like the call to the database some lines before line 1812).
Then try to run the query (the last one written in file /tmp/queries.sql
) directly in your database (without PHP), to see if its result is that big.
If yes, it will be up to you to understand why you have so much data in that table: is it expected? If yes increasing the memory limits will help, if no purge your data.
本文标签:
版权声明:本文标题:wordpress - Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 62914592 bytes) in publicwp-include 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744967742a2635051.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
WP_MEMORY_LIMIT
probably won't solve your problem. – Chris Haas Commented Mar 6 at 16:01