Photosynthesis is incredibly important in numerous ways. Everything in an ecosystem is a part of a food web. Trees, plants, flowers, shrubs, algae, etc. all need the sun in order to convert the suns light into energy. Here is an example that will make it easy to understand. All of the things I listed above cannot survive without using photosynthesis. So for example, there would be no trees. Without trees there would not be hiding places for a number of different animals. Since these animals did not have adequate hiding areas, they would be eaten very easily by predators. Since the predators are eating all of these animals, there would be a shortage of food for them and they may not survive. Every living thing is dependent upon another for survival in some way.
In addition, without the sun providing energy for all the "green" things on this planet, we would not have the oxygen that we need to survive. Without the sun, there would not be any ecosystems.