Try adding '--with-gd=/usr' to the configure for mapserver. Battled this same problems last week. If you're doing php mapscript, do the same thing in the configure for php, so that both programs are using the same version of gd (otherwise php will default to it's own bundled gd). -Camden