Itraconazole capsule is used to treat fungal infections, such as aspergillosis (fungal infection in the lungs), blastomycosis (Gilchrist's disease), or histoplasmosis Darlings disease). Sporanox capsule is also used to treat onychomycosis (fungal infection in the fingernails or toenails.