Presocratics in Greece
Socrates is a false marker for the start of philosophy even in Greece. To begin, if he wrote anything, nothing has come down to us and it is possible (as tradition has it) that he wrote nothing. What little we know of Socrates' ideas and arguments has to be gleaned from Xenophon's Memorabilia of Socrates and the Platonic dialogues. Even if the early Platonic dialogues preserve elements of Socrates' thought, we don't know where Socrates ends and Plato begins.
More than that, there is a whole line of presocratic philosophers of considerable sophistication : Thales, Anaximander, Heraclitus, Pythagoras Parmenides, Zeno, Democritus : and if they left only 'fragments', some of the fragments are pretty hefty. Large parts of the poem of Parmenides remain. (Edward Hussey, The Presocratics, 2013.)
Ancient Egypt
What reasonably counts as ancient Egyptian philosophy is by no means beyond historical reach as the following extract from Charles C. Verharen makes clear. He refers initially to :
the precepts of Ma' at. These prescriptions bear a
remarkable resemblance to the commandments of the religions of
the Book - give drink to the thirsty, food to the hungry, and the
like - yet they may be 2,000 years older than the first books of the
Bible (Assman, 1998).
To sin against Ma' at is to bring chaos into life - before its time.
Chaos is not intrinsically evil because the universe begins in a
chaotic state that is revered as the protean creator of the universe,
Nun. Disorder is evil only when a well-ordered state of affairs is
reduced to chaos in advance of its natural cycle. In a holistic
ontology, good and evil are intrinsic to all existence, not separate
forms of existence.
The Egyptian cosmology finds good in the midst of evil and vice
versa: Seth is not only the murderer of Osiris but a force against
the disintegration of the cosmos into chaos. Seth fights the forces
of chaos nightly to restore the sun at dawn. The classical icon of
Egyptian cosmology is the ouroboros, the figure of a snake consuming itself by eating its tail. The snake is the dread god Apophis,
the embodiment of chaos. The whole universe must return to chaos
in the end, but it will be reborn out of that chaos. For the ancient
Egyptians, evil does not have an independent existence, like Satan
in the religions of the Book. Evil is simply chaos at a time when
Ma'at should rule rather than Apophis. Even Apophis is not irredeemably evil because it is natural for the cosmos to return to
chaos, in its infinite cycle between Nun and Ma'at. The ancient
Egyptians recognize that good and evil are inseparable. One can
never triumph over the other for all eternity (Hornung, 1971/1982).
(Charles C. Verharen, 'Philosophy Against Empire: An Ancient Egyptian Renaissance', Journal of Black Studies, Vol. 36, No. 6 (Jul., 2006), pp. 958-973 : 963.)
Here are clear elements of both ethics and cosmology. It is always possible to question what is philosophy and what is mythology. The linkage between ethics and cosmology, the internal relation between good and evil, the view of evil as privative rather than positive (the absence of order rather than anything existing in its own right) all suggest to me at least nascent philosophical thought. There are philosophical problems in the account Verharen outlines but they need not be probed now.
I have not dwelt on **ancient, presocratic Indian philosophy since it has been dealt with in the preceding answer. I have also not mentioned Chinese philosophy since the question did not ask about this.
_________________________________________________________________________
References
E. Hussey, The Presocratics (Bristol Classical Paperbacks), ISBN 10: 1853994855 / ISBN 13: 9781853994852
Published by Bristol Classical Press, 2013.
Charles C. Verharen, 'Philosophy Against Empire: An Ancient Egyptian Renaissance', Journal of Black Studies, Vol. 36, No. 6 (Jul., 2006), pp. 958-973.
J. Assman, (1998). Moses the Egyptian: The memory of Egypt in western monotheism. Cambridge, MA: Harvard University Press.
E. Hornung, E. (1982). The valley of the kings: Horizon of eternity (D. Warburton, Trans.) New York: Timken. (Original work published 1971.)