The latest mods of Phalanx can be optically guided to take surface contacts. The older models are strictly air defense. They will not even track surface contacts.
They *would* track sea skimming missiles, though - and IIRC there's at least one case where someone left a Phalanx system on and it shredded a truck driving down a dock.