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. There's a lot of documentation on how to use the various configuration features inside php.ini online at http://uk2.php.net/configuration.

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 the PHP memory limit is being set elsewhere, either within your code, or via another php.ini.

Was this answer helpful?

« Back