Cephalexin is a beta‐lactam antibiotic of the first generation of cephalosporins which is very effective against various bacterial infections. In this work, we investigate the structure and antibacterial activity of cephalexin solutions submitted to forced degradation under heat stress and photolytic irradiation. A combination of analytical techniques gathering LC/ESI‐MS and NMR spectroscopy allowed us to identify different chemical species amongst the byproducts, revealing that photolysis via UVA light leads to significant amounts of oxidized species that conserve the dihydrothiazine ring adjacent to the beta‐lactam ring. In contrast, thermodegradation induces the rupture of the bioactive moiety possibly with the production of cephalosporinic acid and deaminated species, which are inactive to bacteria. Microbiological analyses using E. coli as a model organism indicated that the antimicrobial capacity of samples submitted to thermolysis is suppressed while solutions submitted to irradiation with UVA light preserve their bactericidal power. Atomic force microscopy showed that cells incubated with photodegraded cephalexin are much longer than those incubated with the undegraded antibiotic, indicating that byproducts from photolysis inhibit septum formation and likely affect the action of penicillin‐binding protein 3 in the divisome of E. coli cells.