The Muslim account, on the other hand, says that Pihani was founded by Sayyid Abdul Ghafur, who served as qazi of Kannauj under the Mughal emperor Humayun. In 1540, after Humayun's defeat by Sher Shah Suri, Abdul Ghafur refused to acknowledge Sher Shah's rule and left Kannauj to take shelter in the jungle where Pihani now stands. The name "Pihani" is thus said to derive from the word pinhani, meaning "concealment".
According to the Muslim account, Pihani was established by Sayyid Abdul Ghafur, a former qazi of Kannauj who took refuge in the jungle after refusing to acknowledge Sher Shah Suri's rule following Humayun's defeat. The name "Pihani" is believed to originate from the word pinhani, meaning "concealment".