After lots of research, finally i got the solution for making watermark gif image.
You need imagick and magickwand
Try this code it will help to you:
exec("/usr/local/bin/convert mygif.gif null: watermark-logo.png -gravity SouthEast -layers composite -layers optimize mygif.gif 2>&1",$out,$returnval);
Thanks