Hi
in a php script run from a command window, not an html page, I'm getting the following error:

[in part]
message => Allowed memory size of 67108864 bytes exhausted (tried to allocate 34304631 bytes)

Is there a maximum value that I can use to increase the memory_limit for my script? I don't want to add some value too large that may wreck havoc on the server. I'm not sure how that all works. I don't need to set the php.ini file permanently. I can use the ini_set("memory_limit", some-value-here);

Thanks for any help.

    Usually the default of 128M is good enough to do almost anything 10 times over. If you're running into this type of error, check for infinite loops.

    Otherwise, there is no "max" except that of your physical memory on the server. If you have 8 gigs of ram, you're best to max out at around 2 gigs for PHP; however, I would NEVER do that. I'd stick with 128, maybe move to 512 to see if that allows enough memory. if 512M doesn't allow your script to run, chances are the code is doing something funky and you have a loop that is never ending in there.

    If you post your code, we can take a look for ya.

      Write a Reply...