The existing variations in the basic accounts of al-Farabi's origins and pedigree indicate that they were not recorded during his lifetime or soon thereafter by anyone with concrete information, but were based on hearsay or guesses (as is the case with other contemporaries of al-Farabi). The sources for his life are scant which makes the reconstruction of his biography beyond a mere outline nearly impossible. The earliest and more reliable sources, i.e., those composed before the 6th/12th century, that are extant today are so few as to indicate that no one among Fārābī’s successors and their followers, or even unrelated scholars, undertook to write his full biography, a neglect that has to be taken into consideration in assessing his immediate impact. The sources prior to the 6th/12th century consist of: (1) an autobiographical passage by Farabi, preserved by Ibn Abī Uṣaibiʿa. In this passage, Farabi traces the transmission of the instruction of logic and philosophy from antiquity to his days. (2) Reports by Al-Masudi, Ibn al-Nadim and Ibn Hawqal as well as by Said Al-Andalusi (d. 1070), who devoted a biography to him.
When major Arabic biographers decided to write comprehensive entries on Farabi in the 6th-7th/12th-13th centuries, there was very little specific information on hand; this allowed for their acceptance of invented stories about his life which range from benign extrapolation on the basis of some known details to tendentious reconstructions and legends. Most modern biographies of the philosopher present various combinations of elements drawn at will from this concocted material. The sources from the 6th/12th century and later consist essentially of three biographical entries, all other extant reports on Farabi being either dependent on them or even later fabrications: 1) the Syrian tradition represented by Ibn Abī Uṣaibiʿa. 2) The Wafayāt al-aʿyān wa-anbāʾ abnāʾ az-zamān (“Deaths of Eminent Men and History of the Sons of the Epoch”; trans. by Baron de Slane, Ibn Khallikan’s Biographical Dictionary, 1842–74) compiled by Ibn Khallikān. 3) the scanty and legendary Eastern tradition, represented by Ẓahīr-al-Dīn Bayhaqī.
From incidental accounts it is known that he spent significant time in Baghdad with Christian scholars including the cleric Yuhanna ibn Haylan, Yahya ibn Adi, and Abu Ishaq Ibrahim al-Baghdadi. He later spent time in Damascus, Syria and Egypt before returning to Damascus where he died in 950-1.
Al-Farabi spent almost his entire life in Baghdad. In the auto-biographical passage about the appearance of philosophy preserved by Ibn Abī Uṣaibiʿa, Farabi has stated that he had studied logic,medicine and sociology with Yūḥannā b. Ḥaylān up to and including Aristotle’s Posterior Analytics, i.e., according to the order of the books studied in the curriculum, Fārābī said that he studied Porphyry’s Eisagoge and Aristotle’s Categories, De Interpretatione, Prior and Posterior Analytics. His teacher, Yūḥannā b. Ḥaylān, was a Christian cleric who abandoned lay interests and engaged in his ecclesiastical duties, as Fārābī reports. His studies of Aristotelian logic with Yūḥannā in all probability took place in Baghdad, where Al-Masudi tells us Yūḥannā died during the caliphate of al-Moqtader (295-320/908-32). He was in Baghdad at least until the end of September 942 as we learn from notes in some manuscripts of his Mabādeʾ ārāʾ ahl al-madīna al-fāżela, he had started to compose the book in Baghdad at that time and then left and went to Syria. He finished the book in Damascus the following year (331), i.e., by September 943). He also lived and taught for some time in Aleppo. Later on Farabi visited Egypt; and complete six sections summarizing the book Mabādeʾ in Egypt in 337/July 948-June 949. He returned from Egypt to Syria. Al-Masudi writing barely five years after the fact (955-6, the date of the composition of the Tanbīh), says that he died in Damascus in Rajab 339 (between 14 December 950 and 12 January 951). In Syria, he was supported and glorified by Saif ad-Daula, the Hamdanid ruler of Syria.Source: wikipedia