Ivy
Ivy

Reputation: 3573

Where is PHP getting 1028M memory limit?

When running phpinfo on my server I see there is a limit of 1028M, and one of my scripts requires a one-time use of a LOT of memory.

Is there any way I can remove this limit, and let swap handle the memory usage?

The string "1028" does not appear in any php file on my server. In /etc/php.ini the limit is set to -1.

find . -type f -name "*.php" -exec grep -il 1028 {} \;

Upvotes: 0

Views: 524

Answers (4)

Your Common Sense
Your Common Sense

Reputation: 157885

why remove anything? use ini_set() and set whatever amount you wish for the script that requires it.

BTW, 1028M is A LOT of memory.

Upvotes: 0

iWantSimpleLife
iWantSimpleLife

Reputation: 1954

In 32 bit operating systems, PHP can only use up to 1.5Gb of ram. (At least that is what I have discovered in practice). If you want to allow more memory for PHP, you will need to switch to 64 bit operating systems.

The memory limit in the php.ini file, when set to -1 means to use all available memory. But it is misleading.

My best guess is that you are running it under windows or linux 32 bit...

Upvotes: 2

Bas Slagter
Bas Slagter

Reputation: 9929

It's in your .ini file or set in your code somewhere. Since your search in .php files did not give any result it's most likely in your ini file.

Upvotes: 0

oezi
oezi

Reputation: 51807

the memory limit can be set as memory_limit in your php.ini - thats the reason you couldn't find it, you're just searching for *.php files and not *.ini.

for more information, take a look at the documentation. note that you might also have to increase the max_execution_time for such a big script.

Upvotes: 0

Related Questions