I see my problem is a little bit different from yours, but I'll post this answer in case it helps someone else. I was using MB
as shorthand instead of M
when defining my memory_limit, and php was silently ignoring it. I changed it to an integer (in bytes) and the problem was solved.
My php.ini changed as follows: memory_limit = 512MB
to memory_limit = 536870912
. This fixed my problem. Hope it helps with someone else's! You can read up on php's shorthand here.
Good luck!
Edit
As Yaodong points out, you can just as easily use the correct shorthand, "M", instead of using byte values. I changed mine to byte values for debugging purposes and then didn't bother to change it back.