Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have a WordPress installation. When the ownership of the folder is root, the memory consumed is okay. However, when I change the ownership to the www-data user, it starts consuming a lot of memory and starts throwing a lot of out of memory error. I have changed the ownership to root. Why does this happen?

share|improve this question
    
Who is throwing out of memory error - PHP or apache? –  L.R. Mar 14 '10 at 17:35
    
It actually gives an error with a random PHP line number. It seems like a PHP error. But it says out of memory and throws the error –  Unknown Me Mar 14 '10 at 20:19
    
can you show the PHP error and the log information? –  Richard June Mar 14 '10 at 21:02
    
Specifically, what process is it that consumes all your memory? –  Zoredache Mar 14 '10 at 22:51
    
Is this a stock up-to-date wordpress install? I have seen some really badly written templates that do really stupid things and cause havoc. –  Zoredache Mar 14 '10 at 22:53
show 5 more comments

2 Answers

up vote 4 down vote accepted
+50

It is likely to be a memory leak in an installed and enabled plugin.

For example, the wp-super-cache plugin is known to cause problems , like this.

The best approach would be to disable all plugins and themes and then measure memory usage again. Assuming this fixes your problem you can then enable each plugin and theme again to see what effect they have on memory usage.

EDIT: I have found an example of this here, where the ownership of the files in the cache were changed it caused a memory leak as you have described.

In your particular case you first ran this wordpress installation as root, effectively creating files with an ownership that is not writeable by the web server.

You should be able to correct ownership on these files in the cache to resolve your problem.

Of course it may not be the wp-super-cache plugin that is causing your issue. You have not yet posted back if disabling plugins had any effect so I am still working on that assumption.

share|improve this answer
1  
I totally agree. I manage a farm of wp sites and buggy plugins cause the majority of problems i see. Do what Richard says and i bet you'll find the problem. –  anonymouse Mar 18 '10 at 1:10
    
If www-data owns the folders/files then that means PHP can create new files which means that wordpress can waste time and memory working with the filesystem. –  Xeoncross Mar 24 '10 at 3:35
add comment

When you change directory ownership, are you effectively denying write access for www-data? Or, are you setting permissions such that www-data can still write to the WordPress install? Also, are you hitting PHP's memory limit or are you hitting a system wall?

When you run it with root ownership, do you see any errors in your web server logs that indicate a problem writing to disk that you don't see when running with www-data ownership?

Richard up there is probably right. My guess is that root ownership is preventing Wordpress from doing some caching or other file dependent task because it can't write to the local file systems. That failure keeps it from eating up too much memory. When ownership allows writes, it's allowed to do whatever it is that it's doing and it bombs.

share|improve this answer
    
The extreme memory usage happens when the ownership is with the user www-data. When the permission is with root it works fine.I will check the plugin problem thing next. –  Unknown Me Mar 18 '10 at 12:46
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.