Reputation: 1114
I am currently debugging a php-script. I set the memory_limit to 64M and it confirms this:
ini_set("memory_limit","64M");
echo "starting script with ".ini_get("memory_limit")."Bytes of ram\n"; \\64
But nevertheless the script breaks using just 20M giving the standard memory exhausted error.
Fatal error: Allowed memory size of 20971520 byte exhausted
Is there a possibility I probably did not think of ? Maybe Apache is setting something for PHP ?
Upvotes: 4
Views: 2431
Reputation: 51817
maybe the safe_mode
is enabled on your server - if so, a lot of settings can't be changed using ini_set()
. please take a look at your php.ini and check that.
EDIT: what happens if you change the value for memory_limit in the php.ini directly and restart/reload your apache (or whatever)? does it work in that case?
EDIT2 to wuschelhases comment:
Upvotes: 3