4. In $\triangle A B C$, it is known that $A B=7, A C=5$, the angle bisector $A D$ intersects the median $B M$ at point $P$. Then $\frac{A P}{P D}=$
4. $\frac{12}{7}$.

As shown in Figure 4, draw $A N / / B M$, intersecting the extension of $C B$ at point $N$.
Then $N B=B C, \frac{A P}{P D}=\frac{N B}{B D}$, which means
$$
\frac{A P}{P D}=\frac{B C}{B D}=\frac{B D+D C}{B D}=1+\frac{D C}{B D} \text {. }
$$

Since $A D$ is the angle bisector of $\angle B A C$, we have
$$
\frac{D C}{B D}=\frac{A C}{A B}=\frac{5}{7} \text {. }
$$

Therefore, $\frac{A P}{P D}=1+\frac{5}{7}=\frac{12}{7}$.