Method PUT was changed. Function tmpfile has problem with file handle during execution a lot of requests, so fwrite gets false instead of resource.