The answer to this question is simple and requires only SR, not GR or quantum mechanics.
In units with $c=1$, we have $m^2=E^2-p^2$, where $m$ is the invariant mass, $E$ is the mass-energy, and $p$ is the momentum. In terms of logical foundations, there is a variety of ways to demonstrate this. One route starts with Einstein's 1905 paper "Does the inertia of a body depend upon its energy-content?" Another method is to start from the fact that a valid conservation law has to use a tensor, and show that the energy-momentum four-vector is the only tensor that goes over to Newtonian mechanics in the appropriate limit.
Once $m^2=E^2-p^2$ is established, it follows trivially that for a photon, with $m=0$, $E=|p|$, i.e., $p=E/c$ in units with $c \ne 1$.
A lot of the confusion on this topic seems to arise from people assuming that $p=m\gamma v$ should be the definition of momentum. It really isn't an appropriate definition of momentum, because in the case of $m=0$ and $v=c$, it gives an indeterminate form. The indeterminate form can, however, be evaluated as a limit in which $m$ approaches 0 and $E=m\gamma c^2$ is held fixed. The result is again $p=E/c$.