开发者

PHP Memory Limit debugging

开发者 https://www.devze.com 2023-02-24 17:44 出处:网络
I have a client with a Wordpress site. They are running a couple of plugins which are causing Fatal Memory errors. The 2 plugins specifically are Simple Map & Drain Hole.I am not sure which of the

I have a client with a Wordpress site. They are running a couple of plugins which are causing Fatal Memory errors. The 2 plugins specifically are Simple Map & Drain Hole.I am not sure which of these plugins exactly is causing the issue. Simple Map is used to manage locations or providers, much like Google Places. Drain Hole is used to protect files via URL cloaking.

Within Simple Map, they currently have about 900 locations. Within Drain Hole they currently have about 700 files protected. During development, we had no issues whatsoever, as our PHP memory limit was set to 64MB. On their live server, the host only allows 30MB, and will not allow this to be changed.

My issue/question is this: If I move them to a new host, one that allows atleast 64MB, how can I be sure that if they continue to add to those plugins, that this will not happen again? Is there anyway to test if these memory spikes are legitimate, or if they are a result of poor, inefficient code?

EDIT: The fatal error seems to be hit or miss. It only happens in 开发者_运维知识库certain screens of the Wordpress Admin panel, specifically those dealing with Simple Map. Although if I disable the Drain Hole plugin, the error goes away completely. The error:

**Fatal error:** Out of memory (allocated 34078720) (tried to allocate 44 bytes) in /fake/dir/wp-includes/wp-db.php on line 1400


1and1 is notorious for being a bad WP host. WP 3.1 tries to allocate 64megs to itself when run, and in wp-config.php, you can add this line near the top

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

to grab more, if a host allows it. Find a new host, if possible. You're running plugins in an intensive manner that will require that much RAM. It may be a fault of the plugins and of WP, but that's the way it is.


I know that this happens with buggy plug-ins. Unfortunately, it takes turning them off one by one, to see which plug-in is to blame. But after that plug-in is deactivated, you will be fine.

That was my solution when I received that same error.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号