My script needs a higher memory allocation, how do I increase it? Print

  • 0

You can create your own php.ini file inside whatever sub-directory your script is in.

memory_limit = 32M;

and then make or amend a .htaccess file as well

RLimitMEM 256000000

This will increase the memory limit for a php script to 32MB

If this still does not work, take note of the error message that is produced. Is PHP now reporting that it is running out of memory at 32MB, or is it still reporting the old amount? In the former case, try upping the memory again. If you keep getting memory errors at each level, it is quite likely that an infinite loop has been created within your script, and it will run out of memory, no matter how much you use. In the latter case, it is likely that thePHP memory limit is being set elsewhere, either within your code, or via another php.ini.



Was this answer helpful?

« Back