If, as the sun passes the observer in the ship, he sends a flash of that light in the direction of the Earth that flash of light will reach the Earth before the Earth reaches the observer. The observer in the ship will find that the distance traveled by the light (which is considerably less than 93 million miles because of length contraction) divided by the time it takes for the light to reach the Earth (which is considerably less than eight minutes) is equal to the speed of light (of course).
Someone on Earth will interpret the same sequence of events as a flash of light being emitted from the ship as it passes the sun 93 million miles away; it takes the flash of light traveling at c eight minutes to cover the 93 million miles distance and reach the earth.
One interpretation uses clocks and distance measurements from a frame in which the Earth and sun are at rest, and the other uses clocks and distance measurements from a frame in which the ship is at rest. Neither interpretation tells us anything about "the photon's time" - that concept isn't even meaningful because we'd need a clock from a frame in which the photon is at rest to give us the photon's time, and there is no such frame because the thing is moving at the speed of light in all frames. (This is a slightly longer way of saying what haushofer said above. It's also an FAQ in the STEM learning section of this forum
https://www.physicsforums.com/threads/rest-frame-of-a-photon.511170/).