Itraconazole is one type of antifungal medication that's commonly used to treat histoplasmosis. Depending on the severity of the infection and the person's immune status, the course of treatment can range from 3 months to 1 year. Many people will need antifungal treatment for histoplasmosis.