[WHP1.21] My script needs a higher memory allocation, how do I increase it?

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 32000000

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?

 Print this Article

Also Read

[WHP1.13] CGI scripts fail with 'exec format error'

A CGI script must begin with a valid 'interpreter line' also called 'shebang'. That must be the...

[WHP1.19] I've uploaded a compiled CGI program why does it not run?

This applies to Linux hosting accounts only.If the program is a CGI binary written in a language...

[WHP1.07] Why do I get a red (x) where my images are supposed to appear?

I made some changes to my site, but when I view it still has the oCheck to make sure the names of...

[WHP1.11] Why does my PHP script fail with 'Fatal error: Allowed memory size of 8388608 bytes exhausted'?

Support DatabasePrint NowWhy does my PHP script fail with 'Fatal error: Allowed memory size of...

[WHP1.16] Possible issues with OSCommerce and MySQL5

We have been made aware that some customers may have issues with their OSCommerce installations...