Oxygen is a by-product of photosynthesis thus it is not needed for photosynthesis to occur.
Light is needed to provide the energy needed as photosynthesis is endothermic and is also needed to ionise the water molecule to get hydroxide and hydrogen ions and carbon dioxide is what is reduced to starch.