I have running a Debian Squeeze with Standard Apache and PHP, installed via aptitude.
No I try to run :
<?php
echo ini_get("memory_limit")."\n";
ini_set("memory_limit","1024M");
echo ini_get("memory_limit")."\n";
?>
Result: 128M 128M
What I have tried to change this behavior and some facts:
/etc/php5/apache2/php.ini:
safe_mode = Off
memory_limit = 128M
/etc/php5/apache2/conf.d/suhosin.ini:
[suhosin]
suhosin.memory_limit = 2048M
I can verify this settings with phpinfo();, after service apache2 restart
.
Why I can not set the Memory Limit above 128M?
Note:
<?php
echo ini_get("memory_limit")."\n";
ini_set("memory_limit","127M");
echo ini_get("memory_limit")."\n";
?>
Result: 128M 127M
Kind Regards
Changing of
memory_limit
is blocked by suhosin extension.From the docs at: http://www.hardened-php.net/suhosin/configuration.html#suhosin.memory_limit
So with suhosin extension enabled, you need to change it and restart apache.