If you're on the offense use Drop Pikes. It's the picture of the sword. This will increase weapon damage and ap damage and they're still pretty effective against infantry.
When you're defending, don't enter Phalanx untill seconds before the charge. Also, raise you're phalanx when friendlies come around.