A small fraction of phosphorus (up to 10 %) was incorporated in ferromagnetic (Ga,Mn)As epilayers grown on a GaAs substrate. P incorporation allows reducing the epitaxial strain or even change its sign, resulting in strong modifications of the magnetic anisotropy. In particular a reorientation of the easy axis toward the growth direction is observed for high P concentration. It offers an interesting alternative to the metamorphic approach, in particular for magnetization reversal experiments where epitaxial defects stongly affect the domain wall propagation.