Ibn al-Haytham went to Egypt some considerable time after he made the decision to give up his job as a minister and to devote himself to science, for he had made his reputation as a famous scientist while still in Basra. We do know that al-Hakim was Caliph when ibn al-Haytham reached Egypt. Al-Hakim was the second of the Fatimid caliphs to begin his reign in Egypt; al-Aziz was the first of the Fatimid caliphs to do so. Al-Aziz became Caliph in 975 on the death of his father al-Mu'izz.
Ibn al-Haytham nagpunta sa Ehipto ang ilang oras matapos na siya marami na ginawa ang desisyon upang mabigyan up ng kanyang trabaho bilang isang ministro at sa italaga ang sarili sa agham, para sa mga ginawa niya sa kanyang reputasyon bilang isang bantog na siyentipiko habang pa rin sa Basra. We do know na al-Hakim ay Caliph kapag Ibn al-Haytham umabot sa Ehipto. Al-Hakim ay ang ikalawang ng Fatimid calipo upang simulan ang kanyang maghari sa Egypt; al-Aziz ay ang unang ng Fatimid calipo na gawin ito. Al-Aziz naging Caliph sa 975 sa kamatayan ng kanyang ama al-Mu'izz.