A four-alarm blaze ripped through an apartment building injuring five San Francisco firefighters and one resident.