Cephalexin is a generic prescription drug that treats infections. Only the oral capsule comes in a brand-name version called Keflex. Cephalexin can cause side effects ranging from mild to serious.