views:

103

answers:

3

Ah I'm desperate, I so help someone can help me out!

I have a domain: example.com. There are various WP installations for different languages, e.g. /en/, /fr/. I have duplicated the English language /en/ to make these other foreign language installations. The original /en/ installation still works great.

The other installations work on the front-end, it seems, however, when I try to edit a page, for example, I get this error, when updating/saving/submitting:

Fatal error: Out of memory (allocated 28835840) (tried to allocate 35 bytes) in /homepages/../wp-includes/wp-db.php on line 1371

This does not happen with the English language installation (/en/), and does not happen when I change other things in the other blog. For instance, I have managed to change the blog's name, widgets, menus, etc.

I have installed the Memory Booster plugin so PHP now has 256M to work with, but this seems to be running out of memory much earlier.

Does anyone know how to help? :(

So appreciative in advance!!!

A: 

Maybe a silly question, but did you restart your web server after adjusting the memory limit ?

Alternatively, maybe there is an override for the memory limit in a PHP file (ini_set('memory_limit', ...)) somewhere or in an Apache configuration file (php_value / php_admin_value).

You could try to print the effective memory limit by inserting e.g. an

echo '<h1>LIMIT: '.ini_get('memory_limit').'</h1>';

statement right before the line of error (if the error reproducibly occurs at the same location) and reload the offending page to see whether your limit is what you think it is (back up the original file before doing so).

Archimedix
It turns out my host maxes out to 30M, even if you request an increase in any code. It doesn't make sense that only some installations throw the error, though...?
harryfear
I don't really know but it could be that they differ in memory requirements due to localized messages or something... e.g. non-English installations might have both non-English and English (as a fallback language) messages loaded or something the like.
Archimedix
What memory limit does your script print if you include the `echo` statement from above ? And is the error always reproducible on your non-English installs and never on the English WordPress ?
Archimedix
Okay it turns out nothing to do with memory but is definitely a red herring ...
harryfear
How did you find out about that ? Are there any additional clues to look at that might point to the root cause ?
Archimedix
Because I tried on a different system where the memory limit is 256M and it just hangs longer instead... it's not plausible that it's memory-related... Clues: only that I have effectively change the site url and the table prefix...
harryfear
+1  A: 

This error can be a red-herring, i.e. suggests that the problem is to do with memory even when it is not.

jezmck
correct, always the case with packaged systems and frameworks
Stewie
Any ideas what the real cause might be, brother?
harryfear
Okay it turns out nothing to do with memory but is definitely a red herring ...
harryfear
+1  A: 

The problem is that you're running multiple WP installs. Each takes at least 30 megs, and you're running out of it, esp. if your host is cheap and maxes out at 30 meg. Either run one install with the proper impletentation for multiple languages

http://codex.wordpress.org/Multilingual_WordPress

http://wpml.org/

or find a new web host.

songdogtech
But shouldn't the different installations be independent of each other ? I mean, the non-English WordPress does not load the English WordPress, and a shared limit would only have an effect when there were multiple simultaneous requests, and then again, this would affect the English WordPress as well, not just the other ones.
Archimedix
"But shouldn't the different installations be independent of each other?" That's exactly the problem - they are. They are all using memory, all running cron, all using httpd resources, even when idle and no http requests are being made. And that hosting account is very limited to begin with.
songdogtech
Usually, the memory limit in PHP is per script, and when only a single request is made, only that request should be consuming memory (i.e. RAM, as opposed to disk space). Therefore it should not matter if you run one or multiple WordPress installations as long as the hard non-PHP memory limit is 30 MB *and* multiple requests are running at the same time. That said, 256M PHP memory limit should be enough for most PHP scripts out there (as it is per script), however a hard system memory limit of 256 MB may or may not be enough depending on the number of concurrently running PHP scripts.
Archimedix
As of now, it appears that some scripts need more than 30 MB, so 256 MB means that you can have maybe (256 / 30) = 8 such scripts running simultaneously (other scripts may consume less memory). Of course, this also depends on the data you have in WordPress (e.g. more memory for longer blog entries).
Archimedix