Taking antifungal pills for two months can cure an infection under the fingernails. Usually three months of treatment cures a toenail fungal infection. Antifungal pills, however, can cause side effects. Your dermatologist will watch you closely.