There are a bunch of values from various experiments that can be said to be a measured value of the rest mass or simply mass of the photon ..
A photon mass ranges from ~10^-7 eV to ~10^-27 eV. With such wide range of a mass we still have a firm founding on why photon can not be taken to be an extremely small mass rather it is taken to be a zero mass. Even with the highest possible value measured it is by a factor ~10^-12 smaller than the mass of the electron, (imagine a photon is associated with a hypothetical charge of the electron, for comparison sake of mass, we can give it the charge for free). The photon is at-least by a factor ~10^-7 times smaller than the almost massless neutrino which is by a factor ~10^-5, smaller than the electron mass even if it were to have a charge of an electron, which it does not. The **neutrino and photons are chargeless and massless particles but the photon is even by a factor ~10^-7 smaller in it’s mass than the neutrino.
**neutrino almost massless, compare to an electron ..
The 10^-7 mass of the photon is still a value not to be included in the most precise mass of the photon. The most precise value of the photon is ~10^-18 eV, obtained from Plasma studies. The still smaller value of ~10^-27 is studied from methods that involves the Galactic field.
The magnetic field of Sun disperses a very high energetic photon source of the GHz frequency range. Since the magnetic field of the Sun is about twice as big as that of Earth we would think that is causing the measurement to have a larger value of mass/energy. In comparison the Earth’s mag-field measurement and the Jupiter’s mag-field measurement gives a value which is quite close to the best value of ~10^-18 eV. The Jupiter is the most powerful source of magnetic field in the solar system bigger than Sun’s, it varies from 4 to 14 Gauss. **A Gauss as mag-field unit is 10,000 times smaller than the Tesla as a mag-field unit.**
SO the magnetic field of Sun is not playing a role. Actually all measurements of photon mass which are terrestrial in nature (that is involves planetary or solar fields) are quite close to the best value.
SO the only anomaly in the best value of ~10^-18 eV are ~10^-27 eV (Galactic field with or without Higgs mass hypothesis) or ~10^-7 eV (Dispersion by Sun of very high frequency radiowaves)
This deviation is understandable. The measurements in the ~100 Hz light/photon sources are close to the best value of 10^-18 eV. But the 10^9 Hz radiowaves test gives an imprecise mass/energy value. The Galactic field is perhaps off from any powerful interference hence gives a very small value of 10^-27 (with Higgs mass assumption: 10^-26 eV). The dispersion by GHz radiation involves a very small time window in the measurement since frequency is inversely proportional to time. GHz makes the time window really small. For such a sensitive time measurement one must make a correspondingly larger error on energy therefore mass. That is a show-up of uncertainty principle of energy-time. SO we see a large energy or mass for the photon of 10^-7 eV.
For all known cases we say that photon is massless. (it is charge less to the order 10^-35 of electron charge ..)