php has a configurable limit on how much memory it will consume. Your script required more memory. You could increase the limit, but if you don't know why you need so much memory sometimes, you might not want to do that. You may have a bug, or maybe just some poorly written code.
If it happened once, it can happen again. You should find what caused it. php told you the file and line.