php memory_limit problem; where to set?

9 posts / 0 new
Last post
#1 Thu, 05/05/2011 - 06:25
lex

php memory_limit problem; where to set?

Hi,

for a script, I need the PHP memory limit to be 64 or more. It now doesn't run, as it's set to 32, according to phpinfo:

memory_limit local value: 32M master value: 512M

I thought the local value would be set in /home/-virtualserver-/etc/php.ini, but in there I found it to be set to 128M.

Why is it only 32? Does anyone know where I should look? Thanks!

Some details:

Operating system Ubuntu Linux 10.04.1 Webmin version 1.540
Virtualmin version 3.84.gpl GPL Kernel and CPU Linux 2.6.32-30-generic on x86_64

Everything is updated to the latest versions.

Thu, 05/05/2011 - 09:31
andreychek

If your $HOME/etc/php.ini file is set to use a 124M limit, but you're getting 32M, that may mean that this particular Virtual Server is set to use mod_php rather than CGI or FCGID.

If you take a look in Server Configuration -> Website Options, what is the PHP Execution Mode set to there?

-Eric

Fri, 05/06/2011 - 17:05 (Reply to #2)
lex

Thanks Eric,

it's set as "FCGId (run as virtual server owner)". So that's a bit strange then isn't it?

Fri, 05/06/2011 - 17:07 (Reply to #3)
lex

I've set it to CGI wrapper "(run as virtual server owner)" and now it's fine. Let's see if that has other consequences.

Thanks Eric!

Fri, 05/06/2011 - 17:09 (Reply to #4)
lex

Oh sorry, I was looking at the wrong place. It's still 32...

Fri, 05/06/2011 - 17:38
andreychek

There is an issue in Ubuntu 10.04 that caused all websites, whether they ran in CGI, FCGID, or mod_php -- to run under mod_php.

That's been corrected in newer versions of the install.sh, but if you have an older installation (or an older install.sh version), it's possible that bug is present on your server.

Take a look at /etc/apache2/mods_enabled/php5.conf, are there any "SetHandler" lines in there?

If so, comment those out, and restart Apache. Then, try it again and see if that works for you.

-Eric

Sat, 05/07/2011 - 03:40 (Reply to #6)
lex

Thanks Eric, that worked!

Sat, 05/07/2011 - 03:54
lex

Looking at the server with 'top', I now notice that there quite a few 'php5-cgi's at the top of the list using quite a bit of memory.

Am I correct to think these would have shown as 'apache2' before this change?

Thanks.

Sat, 05/07/2011 - 10:09
andreychek

Yeah, PHP runs as a separate process in CGI and FCGID. All the PHP modules would have previously been loaded within Apache.

-Eric

Topic locked