tags:

views:

250

answers:

3

I just noticed that I am unable to increase my memory limit above the value configured in php.ini using ini_set(). I can, however, set it to any value below that and increase it to any other value below the one defined in the ini-file.

Does anyone know why this happens or how I could fix it?

+1  A: 

Check your "safe_mode" setting - if enabled, it might prevent you from raising the memory_limit (allthough it's not documented).

chluehr
`safe_mode` is disabled
soulmerge
A: 

you can not override memory limit on shared hosting accounts. that's simple. get a private (dedicated) hosting and you ask your provider to set it all the way up (although not recommended).

dusoft
The reason it is not possible on shared hosting accounts is that they normally have `safe_mode` enabled, which is not the case on my local machine.
soulmerge
+2  A: 

This is odd, according to the manual the memory limit can be set anywhere.

  • Do you have Suhosin installed? With Suhosin, it's possible to impose a global memory limit.

  • Do you have a .htaccess file lying around somewhere saying php_value memory_limit xyz?

  • Do you have Shell Fork Bomb protection activated? It can impose a global memory limit. See the SO question here. (I suppose this could be part of Suhosin).

  • What does your phpinfo() say concerning "local" and "global" memory_limit values?

  • How do you specify the limit, can you post a code snippet?

Pekka
Many thanks, it was the suhosin patch. The default value of `suhosin.memory_limit` was causing this behaviour: http://www.hardened-php.net/suhosin/configuration.html#suhosin.memory_limit
soulmerge