What is the mass of a photon?

This question falls into two parts:

Does the photon have mass? After all, it has energy and energy is equivalent to
mass.

Photons are traditionally said to be massless. This is a figure of speech that
physicists use to describe something about how a photon's particle-like properties are
described by the language of special relativity.

The logic can be constructed in many ways, and the following is one such. Take an
isolated system (called a "particle") and accelerate it to some velocity v
(a vector). Newton defined the "momentum" p of this particle (also a
vector), such that p behaves in a simple way when the particle is
accelerated, or when it's involved in a collision. For this simple behaviour to
hold, it turns out that p must be proportional to v.
The proportionality constant is called the particle's "mass" m, so that
p = mv.

In special relativity, it turns out that we are still able to define a particle's
momentum p such that it behaves in well-defined ways that are an extension
of the newtonian case. Although p and v still point
in the same direction, it turns out that they are no longer proportional; the best we can
do is relate them via the particle's "relativistic mass" mrel.
Thus

p = mrelv .

When the particle is at rest, its relativistic mass has a minimum value called the "rest
mass" mrest. The rest mass is always the same for the same type of particle.
For example, all protons have identical rest masses, and so do all electrons, and so do all neutrons; these
masses can be looked up in a table. As the particle is accelerated to ever higher speeds, its
relativistic mass increases without limit.

It also turns out that in special relativity, we are able to define the concept of
"energy" E, such that E has simple and well-defined properties just like
those it has in newtonian mechanics. When a particle has been accelerated so that it
has some momentum p (the length of the vector p) and relativistic
mass mrel, then its energy E turns out to be given by

E = mrelc2 , and
also E2 = p2c2 +
m2restc4 .
(1)

There are two interesting cases of this last equation:

If the particle is at rest, then p = 0, and E =
mrestc2.

If we set the rest mass equal to zero (regardless of whether or not that's a
reasonable thing to do), then E = pc.

In classical electromagnetic theory, light turns out to have energy E and
momentum p, and these happen to be related by E = pc. Quantum
mechanics introduces the idea that light can be viewed as a collection of "particles":
photons. Even though these photons cannot be brought to rest, and so the idea of
rest mass doesn't really apply to them, we can certainly bring these "particles" of light
into the fold of equation (1) by just considering them to have no rest mass. That
way, equation (1) gives the correct expression for light, E = pc, and no harm has
been done. Equation (1) is now able to be applied to particles of matter
and "particles" of light. It can now be used as a fully general equation,
and that makes it very useful.

Is there any experimental evidence that the photon has zero rest mass?

Alternative theories of the photon include a term that behaves like a mass, and this
gives rise to the very advanced idea of a "massive photon". If the rest mass of the
photon were non-zero, the theory of quantum electrodynamics would be "in trouble"
primarily through loss of gauge invariance, which would make it non-renormalisable; also,
charge conservation would no longer be absolutely guaranteed, as it is if photons have
zero rest mass. But regardless of what any theory might predict, it is still
necessary to check this prediction by doing an experiment.

It is almost certainly impossible to do any experiment that would establish the photon
rest mass to be exactly zero. The best we can hope to do is place limits on
it. A non-zero rest mass would introduce a small damping factor in the inverse
square Coulomb law of electrostatic forces. That means the electrostatic force would
be weaker over very large distances.

Likewise, the behavior of static magnetic fields would be modified. An upper
limit to the photon mass can be inferred through satellite measurements of planetary
magnetic fields. The Charge Composition Explorer spacecraft was used to derive an
upper limit of 6 × 10−16 eV with high certainty. This was
slightly improved in 1998 by Roderic Lakes in a laboratory experiment that looked for
anomalous forces on a Cavendish balance. The new limit is 7 ×
10−17 eV. Studies of galactic magnetic fields suggest a much better
limit of less than 3 × 10−27 eV, but there is some doubt about the
validity of this method.