Al-Maqrizi, attributing the story to Ibrahim ibn Wasif Shah, relates most of the same story as the Akhbar al-zaman, but he reorganizes it, combining all of Philemon’s dreams and placing them as one event in the time of Surid. In another place he gives the story of the Ark told above, again from ibn Wasif Shah. He later reports another version of the story, from what he says is a long chain of transmission dating back to Muhammad ibn Ali bin Sakhr Al-Tamimi (whoever that was; all I know is that he predates 834 CE, since the first author who cited him died then) that gives a similar story without mentioning any names. According to this version, some Muslim scholars studied an old document from the time of Philip the Arab in the monastery of Abu Jeremias (Abu Hirmis), which Al-Maqrizi and all the historians of the time wrongly believed (based on a bad translation) was the House of Hermes Trismegistus. This document claimed to be a copy of a primordial account written by the son of the one righteous Egyptian who had escaped on the Ark after warning Surid, who “raised a house (temple) in the Delta and in the Saïd and engraved on their walls the details of science, astronomy and prognostication, the stars, alchemy, art, medicine, and all the useful or harmful things.” The majority of the text is identical to that of the earlier versions, leaving no doubt that Philemon was the intended subject.
The various versions are clearly related, but the details differ enough that their exact genealogy is a bit unclear. To make matters worse, Al-Maqrizi sometimes exchanges the name of Philemon (Aqlimun) with the magician-pharaoh he named Qlimun, as in 2.2, when citing ibn Wasif Shah, he claims that Qlimun returned to Egypt after riding out the Flood in the Ark to read science off of Egyptian stones.
I can’t help but wonder if Philemon was named for Ovid’s myth of Baucis and Philemon, itself also related in some sense to the Flood. In that story, told in Metamorphoses 8.621-696 a disguised Zeus and Hermes visit Philemon and his wife, who show them hospitality unlike all the other people of the town. Zeus warns them to flee, and he destroys the town by flood, leaving Philemon and his wife to turn into a tree beside their house, made into a temple. The idea of a temple guardian with foreknowledge of the Flood and an association with a “tree” (= wood for the ark?) seems too close to be coincidental. The story was well-known to Christians, as evidenced from Acts 14:11-12, where Paul and Barnabas are hailed as the disguised Zeus and Hermes.
We have some clues, though, about where Philemon came from. Panodorus attributed to the Watchers a 360 degree zodiac, which the Arabs said Philemon saw in a dream, like Enoch before him. According to Maqrizi, ibn Wasif Shah reported that Philemon returned to Egypt after the Flood with all his disciples, and they recovered manuscripts and the sciences written on the walls of the temples, and they restored the science of alchemy, just as the second Hermes does in the account of pseudo-Manetho.
In chapter 2 of the Akhbar al-zaman, which cared nothing for consistency or coherence, a very familiar story plays out before the Flood, with the earliest Egyptian king, though the author has included details that, bizarrely, have made Philemon admirably near-immortal:
The first who reigned in Egypt before the Flood was Nekraws. After the sons of Adam, who had committed injustice against each other, were delivered into battle, control had passed into the hands of the sons of Cain, sons of Adam; then Nekraws the giant, son of Mizraim, son of Merakil, son of Dawil, son of Arbak, son of Adam, with seventy horsemen and some descendants of Arbâk, all giants, sought a place to live apart from other men. This company walked until they had reached the Nile, and then they walked along the river and, having seen the extent of the country and its admirable beauty, they said: “This is a country with crops and fruits,” and they made their home there. This is the race that built the tallest buildings and most magnificent monuments.
Nekraws built Misr, and called this city by the name of his father Mizraim in order to receive his blessing. Nekraws was a giant, endowed with great courage and prodigious strength. Besides this, he was learned; he was the master of the race of djinn. He ruled over the sons of his father and his authority grew continuously. He collected the science that the angel Darâbîl had taught to Adam, and by these means he kept under his yoke the giants, his companions; these are the princes who built monuments, erected high towers, and executed the wonderful works; who produced talismans, exploited the mines, and tamed the kings of the earth all around them. Nobody could do anything to oppose them, for all perfect science was in the possession of the Egyptians. Their secrets are engraved on stones. They say Philemon, who went with Noah into the ark, is the one who wrote their inscriptions and who composed their books.
The characters of the first and second Hermes were never clearly differentiated; the Greek chronographers invented them to explain how Hermes could live both before and after the Flood according to the various legends they accepted uncritically. But their composite characters were both closely modeled on Enoch and his ilk from the apocryphal literature of Judaism. Thus, we find that just as the Greeks made two Hermeses, they also made two Misr (Mizraims), so stories told of the antediluvians and the post-diluvians could both be kept without picking between them. Al-Maqrizi, in Al-Khitat 1.7, offers a revelatory explanation for it, writing that while everyone agrees Egypt was named after Misr or Mizraim, most wrongly identify him as “Misr the son of Ham, while in reality he is the son of Hermes, son of Herdush, son of Bitun, son of Rawa, son of Lithi, of Yunnan (Ionia; i.e., Greece). It is from him that Egypt has taken the name Misr, which is a Macedonian name.” According to Al-Maqrizi, a lost work of Al-Mas‘udi, the Akhbar al-zaman (a different one) said that after the Flood, Philemon proposed renaming Egypt after a different Misr, Noah’s descendant, and his co-religionist. Thus, Egypt had two namesakes called Misr, giving it the title of Mizraim, the land of two Misrs.
Even in a euhemerized account of Egyptian history, we run time and again into Hermes! Such an account, which makes no sense coming from an Arab pen in the Islamic era, must be a product of the Hellenistic, Roman, or Christian period when Greek speakers had good reason to assert a Macedonian or Greek supremacy over Egypt. I suspect we see the pen of Annianus lurking behind this, too.
Philemon’s role standing in for Hermes and Enoch (whom Anninanus and his predecessor Panodorus considered the same), at least in the form of the second Hermes, seems to find confirmation in his dream visions, both his own and the dream vision of Surid which seems to have been originally part of Philemon’s story before the Flood before someone relocated it to the construction of pyramids 300 years earlier. There is a strange echo of these dreams in Enochian references in Jewish literature. The medieval Book of Jasher, which incorporates older Jewish lore, said that Enoch reigned over 130 princes for 243 years (Jasher 3:10), just as Philemon presided over 130 priests for the more or less 250 years from Surid’s vision to the Flood. (I didn’t calculate it to the day.) In 1 Enoch 26, Enoch has a dream vision of two massive mountains and a smaller one between them, and there was a lush garden with a terrible valley in the center. The valley is the horrible place where the Watchers and Nephilim shall be punished. This dream vision closely parallels that of Surid, who saw two mountains and white birds, likely symbolizing angels, depositing his countrymen, presumably corrupt Cainite Nephilim, in between, in the dread valley. Beyond that, the dream visions also reflect general Christian apocalyptic motifs. The angels beating people with rods and the birds gathering for the judgment are a close parallel to Revelation 19, where the Son of Man on his white horse smites the unbelievers with an iron rod and an angel, speaking as the sun, calls the birds together to feast on their corpses.