As @Gautampk specified in the comment, it is the problem of the formula.
it still carries energy, but if energy is equivalent to mass then how is it that a photon can travel at the speed of light?
Photons still carry energy, as you have pointed out. So where is it stored, if not in form of their rest mass? Their kinetic energy - and therefore momentum. It turns out that because of publicity, people are so familiar with $$E=mc^2$$ that they forget that this is the rest energy - energy of a particle in its rest frame, related to its invariant mass. When a particle is moving, there is an additional momentum term to it. In other words, energy is equivalent to mass only in the rest frame of an object - but photons have no rest frame by the postulates of SR. They move at $c$ in all frames.
The total energy of a particle comes from energy-momentum fourvector norm invariance under Lorentz transformation. It reads
$$E^2=(pc)^2+(mc^2)^2.$$ Note that in a particle rest frame $p=0$ so we are only left with good ye olde familiar E is m c squared. Now, photons have zero rest mass, and so have zero rest energy. All of it is associated with their momentum:
$$E=pc$$
On a side note, a more interesting bit:
Back to the original question, are photons an exception? Well, they are, but only in the sense that it is their speed that is selected to be invariant. Eistein could have equally valid say that gravitons travel at the speed of gravity and therefore photons travel at the speed of gravity. But this is only human perspective. The mathematics of SR is the same to them.
In Rindler's Introduction to Special Relativity, you can find an indeed very profound remark: if suddenly all the electromagnetism was just wiped out of the world like it's never been there, SR would be still valid as long as there are things that propagate through vacuum.
The photon is an elementary particle of mass zero in the table of the Standard Model of particle physics. In particle physics the four vector algebra of special relativity is used in the SM to model all experimental observations.
This is how the invariant mass of a particle is defined by the four vector $(E,p_x,p_y,p_z)$. Composite particles add up to one four vector and the composite has an invariant mass.
Note when the invariant mass is zero . When the momentum is zero, i.e. in the rest frame of the particle, one gets the $E=m_0c^2$.
The relativistic mass is not used in particle physics because of the confusions as in your question. One has to use the four vectors to be consistent with special relativity. The relativistic mass is an outdated concept .
The SM has been validated in most experiments up to now( the exceptions pointing to searches for new physics). The data are consistent with the mass of the photon being zero.
Best Answer
Short answer: no.
Explanation:
Many introductory text books talk about "rest mass" and "relativistic mass" and say that the "rest mass" is the mass measured in the particles rest frame.
That's not wrong, you can do physics in that point of view, but that is not how people talk about and define mass anymore.
In the modern view each particle has one and only one mass defined by the square of it's energy--momentum four vector (which being a Lorentz invariant you can calculate in any inertial frame): $$ m^2 \equiv p^2 = (E, \vec{p})^2 = E^2 - \vec{p}^2 $$
For a photon this value is zero. In any frame, and that allows people to reasonably say that the photon has zero mass without needing to define a rest frame for it.