The amount that it shows you in tried to allocate xxxx bytes
is the amount over and above the memory limit in PHP. This means you have exhausted your 128MB while you were trying to allocate an additional ~80MB.
Even if you can fit the file into memory, when you know the file is going to be that large, it will be a lot better for you to use a combination of fopen
/fread
/fwrite
/fclose
.
I assume that you're going more than just reading the contents and writing it to another file, though, right? Because if that's all you need, you can just use the copy
function.