replace file_get_contents with curl, as the former was causing some php errors