For what I am doing here, see this.
In some sense philosophy is essential to any civilization: civilizations have to order priorities, and setting things in order is what philosophical thinking is. However, this is often very unsystematic. We can trace philosophy in a more systematic sense, at least in the Western world, back to ancient Ionia. Ionia was a Greek colony in what is modern-day Turkey.
One of the major cities of ancient Ionia was Miletus, which was a seacoast city near the mouth of the Maeander River. In the sixth century BC Miletus was the center of of a burst of creative activity which formed what has since become known (somewhat misleadingly, because it was not a unified movement) as the Milesian school of pre-Socratic philosophy. Three thinkers in particular are important to this movement:
Thales: If one were to try to identify a 'first philosopher' among the ancient Greeks, Thales would be a good choice; Aristotle, in fact, will later call him exactly this. We don't know many precise details about him (or any of the Milesians) but we do know that he was interested in the natural world and accurately predicted the eclipse of May 28, 585 BC. He became famous for his wisdom and understanding of the world. We have no writings from him, but according to Aristotle Thales was the first to try to explain things not by appealing to the gods but by trying to figure out the nature of the world. According to Thales, the nature of the world was water. Given that Thales came from wet Miletus, one can see how someone might think this: water can be gas, liquid, or solid, so it's only a short distance to thinking that perhaps all other changes in the world are variations on the same process water undergoes.
Anaximander: Anaximander took up the same questions Thales (who seems to have been his teacher) did. A late work by Themistius claims that he was the first philosopher to write a treatise on nature, but this might be a mistake. He is said to have suggested that the actual nature that Thales had been looking for was not water but what he called the apeiron, or unbounded: something so indeterminate that it can be opposite things like water and fire, air and earth. He may have been the first to suggest that the earth was suspended in the middle of the world, not resting on anything else, and may also have been the first to realize that the Sun was a very large object; he also seems to have held that thunder was not an action of the gods but simply the clouds hitting each other.
Anaximenes: Anaximenes seems to have held the view that Thales's underlying substance was air. We don't know much else about him, but he does seem to have tried to go farther than others had in analyzing the classical list of the four elements (fire, water, earth, and air) by identifying them in terms of more fundamental features (cold and hot, wet and dry).
Milesian ideas seem to have been taken up and debated elsewhere in Ionia, and there are a number of names of non-Milesians from Ionia that come down to us. The most notable of these was
Heraclitus: A notable thinker from Ephesus, he seems to have held that the root substance was fire. But he went farther than the Milesians by recognizing that the fundamental issue was not so much the basic material as the nature of change itself. According to fragmentary sayings attributed to him, he held that everything is constantly changing ('You cannot step into the same river twice') and that change is a conflict of opposites. By raising the question of change itself, Heraclitus is essentially taking the Milesian project and raising it to a more abstract level.
All of the Ionian philosophers are notable for trying to go beyond pious explanation of events by appeal to the gods in order to determine what it is in the nature of things that makes things change the way they do. Because of this, one sometimes hears the phrase "Ionian Enchantment" associated with discussions of natural science: the Ionian Enchantment is the wonder generated by thinking of the natural world as intelligible and orderly, and is sometimes said to be the heart of the scientific approach to the world. We have to be careful of anachronism, but if we interpret the idea that the world has an intelligible order following natural laws broadly enough, it isn't unreasonable to say that it begins with the new questions that were raised by the Ionians. Of course, things had a long way to go; but the mere fact of raising these questions about change was an innovation, and the beginning of a long and fruitful journey.