Edit after this comment:
can you please tell me if the photon has no EM charge, why does it still interact with the electric field of a charge (like and electron), via virtual photons? Does it attract or repel? I understand that when a photon interacts with the electric field of a charge (like an electron), it is not the same as when an electron interacts with a proton, because they attract. Neither like when two electrons interact, they repel. What does the electron's electric field do to the photon, does it repel or attract it? – Árpád Szendrei
The mistake is thinking in terms of electric field at the quantum level. The classical electric and magnetic fields are emergent quantities from the underlying quantum mechanical quantized Maxwell equations. "Emergent" means there is not one to one correspondance of the variables at the quantum mechanical level with the variables the one measures at the classical macroscopic level. Only demonstrable mathematical continuity.
Take the example of thermodynamics where the variables emerge from the underlying statistical mechanics variables, example: the temperature is related to the mean kinetic energy.
The classical fields can be seen to emerge mathematically from the quantum mechanical fields here.
In particular the photon obeys a quantized Maxwell equation and the E an B fields are connected to the mean values of the classical light
BUT within the wave function, which is a complex one and can only have a meaning as a probability distribution after interactions.
the questions in the comments:
Can you please tell me if the photon has no EM charge, why does it still interact with the electric field of a charge (like and electron), via virtual photons?
From the above you must understand that the classical electric field does not play a role at the quantum level, it will emerge at the classical level after integration over the quantum mechanical variables, similar as to how temperature can be defined as emergent from the underlying statistical mechanics level. It is because the same differential equation is being used for classical light and the description of a photon that the variables can be identified with the same symbol, E and B and convoluted for large dimensions to the classical fields. The interactions of the photon are perfectly described by quantum field theory, giving compton etc scatterings.
Does it attract or repel?
Depending on the sums of the Feynman diagrams it either scatters off , ( repel) or contributes to the attraction between charges as a virtual photon.
I understand that when a photon interacts with the electric field of a charge (like an electron), it is not the same as when an electron interacts with a proton, because they attract. Neither like when two electrons interact, they repel.
The photon, a quantum mechanical entity with a wavefunction describing it,interacts with an electron, another quantum mechanical entity described by a wavefunction. The electric field has no meaning for the electron. The photon will interact with the potential, which appears in the quantum mechanical framework, as in the hydrogen atom: one uses the 1/r potential, not the electric field.
The photon just has energy and spin, and only virtually a value for electric and magnetic field, in its wave function.
What does the electron's electric field do to the photon, does it repel or attract it?
It does nothing directly, only mathematically through the integrals involved in the scatter where the values become real and measurable as an interaction, as described in the original answer. Repulsion or attraction will depend on the initial values and other boundary conditions in calculating the crossections.