ini_set("memory_limit") in PHP 5.3.3 is not working at all

The Solution to ini_set("memory_limit") in PHP 5.3.3 is not working at all is


Most likely your sushosin updated, which changed the default of suhosin.memory_limit from disabled to 0 (which won't allow any updates to memory_limit).

On Debian, change /etc/php5/conf.d/suhosin.ini

;suhosin.memory_limit = 0

to

suhosin.memory_limit = 2G

Or whichever value you are comfortable with. You can find the changelog of Sushosin at http://www.hardened-php.net/hphp/changelog.html, which says:

Changed the way the memory_limit protection is implemented

~ Answered on 2011-04-20 08:24:53


Most Viewed Questions: