I have a hunch that you didn't write any of this code.

the function you have there, gzfile_get_contents(), returns the contents of the gzipped file. it doesn't return a filename that you can open. you only need to parse it from then on.