Answered Dec 15, 2017
Thanks for the A2A.
The answer is “no”, because photosynthesis is about using the energy from sunlight, to help use carbon dioxide as a building-block to put together sugar molecules, which are made of carbon, hydrogen, and oxygen. Those sugars function as energy storage (which is how plants survive every night), and also as building material, which is how plants grow new stems, leaves, etc.
Some bacteria can do photosynthesis for sugar-assembly, but there are many other essential nutrients.
If the organism has the necessary enzymes, they can use certain “carbon skeletons” (including acetyl-CoA and Krebs cycle intermediates) as building blocks for lipids and part of amino acids.
However, it still needs to get certain other, vital things from the environment (which cannot be generated by photosynthesis, either by bacteria or by plants).
It needs things like:
Those need to be obtained from the environment, which can be anything from the jelly-like medium in a petri dish, based on various recipes, by microbiologists (ahem), to just the regular, random soil in your backyard (different places support different microbes).
Another commentator seemed to interpret your question as being about food for humans. And the answer on that is “no”, because your food needs to get the above-listed nutrients from someplace that isn’t just photosynthesis.