memory_limit issue php script

283 views Asked by At

How exactly does ini_set() work? I have the following code .

ini_set('memory_limit', '4G');

Which throws this

PHP Fatal error: Allowed memory size of 31457280 bytes exhausted

However

ini_set("memory_limit","30M");

works just fine. How is that possible? The second value is lower than the first.

1

There are 1 answers

0
rohitr On

HI Try following Code in your php ini_set function

  ini_set("memory_limit",-1);