After all, the entire fossil fuel reserves of planet Earth were generated over time by photosynthesis, i.e. the solar-powered capture of atmospheric carbon and its reduction to the hydrocarbon state from the carbon dioxide state.
The problem is the scale of the effort needed to replace current generation with solar generatioin. Practically, it would take decades and a vast amount of work. However, there are no technological barriers, and if the world had exhausted its fossil fuel reserves in say, 1970 then we'd already have much of the solar infrastructure in place.
As far as storage solutions, you can find dozens of strategies. My favorite is using solar energy to capture carbon for carbon fiber building materials, 'aerochemical' products (as opposed to petrochemical) for industrial needs (dyes, solvents, etc.) and of course RP1 jet/rocket production. Clearly such an approach will be needed for interplanetary travel as well (Mars seems to have enough CO2 and H2O to make this viable).
It's not surprising that people are so poorly informed, however, as the fossil fuel sector runs massive propaganda operations targeting childhood education onwards.