“The Prophet (ﷺ) commanded me, when I was suffering, from live, to shave my head and fast for three days or feed six poor persons. He knew that I did not have an animal I could sacrifice.”
Sunan Ibn Majah Book 25, Hadith 199