Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
290 views
in Technique[技术] by (71.8m points)

php - Wordpress : Fatal error: Allowed memory ... exhausted

I read through the answers on questions similar to this one, and haven't found anything that has resolved this issue.

I am receiving the following error on various pages on my site.

Fatal error: Allowed memory size of 16777216 bytes exhausted (tried to allocate 7680 bytes) in [...]/wp-includes/taxonomy.php on line 2930

The steps I've tried to resolve this are:

  • Request memory in wp-config.php by adding the line "define('WP_MEMORY_LIMIT', '256M');"

  • Increase the memory request for PHP in php.ini by updating the line to "memory_limit = 256M"

  • Running phpinfo() informs me that the memory_limit is (as far as it thinks, I guess) set at 256M.

  • Installed the

  • It seems to help reduce the frequency of these errors by changing the flag in wp-config.php from:

    define('WP_CACHE', true); //Added by WP-Cache Manager
    

    to

    define('WP_CACHE', false); //Added by WP-Cache Manager
    

    but that's obviously not a great solution, as I want caching enabled. That said, I couldn't even log in before I made that change.

  • I installed the WP-Memory-Usage plug-in: I'm apparently using 33.58MB to view the wp-admin/dashboard

There's only a few plug-ins installed, the site is on shared hosting, it receives maybe 5-10 views a day.

Any thoughts on how to resolve the memory issue? Is it an issue with the cache? I have an email out to my webhost.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

From experience, 16MB is very little for a Wordpress installation as it is - WP simply is very fat. If you then have a few plugins running, you will be bound to hit the limit frequently.

Maybe somebody can come up with some memory saving tweaks, but failing that, I think talking to your provider and asking them to raise the limit to 24 or (better) 32MB is the best way to go.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...