Abū Ḥāmid Muḥammad b. Muḥammad al-Ghazzālī was born in 451/1059 and spent his youth in Ṭūs in Khurāsān. He received his theological training in Nishapur under Imām al-Ḥaramayn, during whose lifetime he began writing. After the former’s death in 478/1085 he joined the vizier Niẓām al-Mulk, who assigned him a professorship at the al-Niẓāmiyya academy that he had founded in Baghdad. While he was still in his youth he rejected taqlīd.
He tried to live up to the obligations of his office by an intensive study of all the madhāhib and philosophical schools while also composing various works on fiqh and polemic pamphlets against the Bāṭiniyya, who had murdered Niẓām al-Mulk in 485/1092. But none of these systems could satisfy him. In the end he did not only feel his faith falter, but despaired even of the possiblity of achieving any knowledge whatsoever. An intense struggle for the salvation of his soul, which he saw threatened in the hereafter, shook him from Rajab until Dhu ’l-Qaʿda 488/July–November 1095. As a result of this he relinquished his professorship in favour of his brother Aḥmad and, as a wandering dervish, regained his inward peace through asceticism and mystical contemplation.
Perhaps the conflict between the Sultan Barqyārūq and the latter’s uncle Tutush had also precipitated his decision to step down from his post. He was a close ally of the caliph who had declared himself in favour of Tutush and who, after the elimination of the latter, had to fear Barqyārūq’s revenge. He first went to Damascus, and in 490/1097 made the pilgrimage to Mecca. He then lived for nine years in silent reclusion in various places, rarely interrupted by visits to his kin. His spiritual crisis was resolved in a mystical experience of beatific vision, after which he not only rejected the sciences of the fuqahāʾ but also those of the mutakallimūn as being of no value. The only thing he would recommend as a means to purify the soul was asceticism, by which one acquired the power to depart from the earth, with all its impurities, towards the pure, uncontaminated sphere of the godhead. This turn towards Platonism was for him connected to an ethics akin to the one of Christianity, and, vanquishing the sanctity of the praxis of Islamic deontology, he had released it from its impending ossification. This new way of thinking he developed in his Iḥyāʾ, from which, even during his years of seclusion, he occasionally recited in Damascus and Baghdad.
After the death of Baryārūq, the latter’s brother Muḥammad assumed power in 498/1104. It was to him that al-Ghazzālī dedicated his mirror for princes al-Tibr al-masbūk, which he had originally written in Persian. He believed there was reason to regard Muḥammad as the prince who could make his religious ideals come true. His homeland of Khurāsān was governed by the latter’s brother Sanjar, and his vizier was Fakhr al-Mulk, the son of Niẓām al-Mulk. The latter succeded in motivating al-Ghazzālī to resume his teaching at the Niẓāmiyya of Nishapur. But he did not live a life in the public sphere for very long, and he soon retired to his hometown of Ṭūs. In the Ṭabarān quarter there he worked at a madrasa with a small circle of students, and also at a khānqāh that he had founded, until he died on 14 Jumādā II 505/19 December 1111.
While al-Ashʿarī had used Greek dialectic to deliver Islamic dogmatics from the naïve subtleties of the old mutakallimūn, al-Ghazzālī secured for Islam the vigour of its religious life. He did this by bringing about the recognition of a mysticism that had been purged of its excesses and which he had philosophically underpinned. That he was very much aware of his calling as a renewer of religion, who, according to ḥadīth, was expected at the turn of every century, is evident from the title of his magnum opus, al-Iḥyāʾ.
Source: Brockelmann, Carl. The History of the Arabic Written Tradition. (Leiden and Boston: Brill, 2017), translated by Joep Lameer, pp. 1:468-9