I was getting this error:
PHP Fatal error: Allowed memory size of X bytes exhausted
So, after some research I changed my php.ini file:
memory_limit: 2048M
The previous error message stoped but I get this error instead:
Fatal error: Out of memory (allocated 1746927616) (tried to allocate 268435456 bytes) in [path]
So I've got 2048M as memory limit and in my error the php file allocated 1666M and tried to allocate 256M which give 1922M. This value is smaller than my memory limit so why I am getting this error? (I've checked the php info in my IIS site and the memory limit is the one I mention before).
Thanks :)
EDIT:
Right before the line in which this error ocorred I did a
echo memory_get_usage();
And I got:
1675848
The code where's the error is this:
for ($i = $startKey; $i <= $endKey; $i++) {
array_push($paginas, $files[$i]);
}