He has a stomach ulcer and the doctors have advised him not to fast
Question

There is a man who has had a stomach ulcer for eight years, and he is still undergoing treatment. The doctors have advised him not to fast lest it make the illness worse. Is that permissible for him?.
Praise be to Allah.He is allowed not to fast, but he has to make it up after he recovers if there is the hope that he will recover. If that is not the case and it is not possible that he will recover from this sickness, then he may feed one poor person for each day of the month of Ramadaan. End quote. 
Fataawa al-Shaykh Muhammad ibn Ibraaheem (may Allah have mercy on him) (4/180).