Pneumocystis infections are caused by a certain type of fungus. The fungus is known as pneumocystis jirovec. It lives in the lungs of many people.