Photon does not violates conservation of energy at any length and time scale, whereas virtual particle does violates the conservation of energy at short time scale using uncertainty principle.. Existence of photon arises due to the time varying of electric and magnetic field. Once the time varying electric and magnetic field ceases, photon can not exist afterward.