In recent decades, bacterial and viral infectionsand chronic inflammatory response have emerged asimportant causes of cancer. Also, infections remain asignificant cause of morbidity and mortality in cancer patients.In this work, carboxymethyl chitosan nanoparticles (CMCNPs) were synthesized in a facile and green way and furthercombined with ammonium methylbenzene blue (MB) as across-linking agent as well as a fluorescent molecule and aphotosensitizer for self-imaging photodynamic therapy(PDT). The obtained CMC?MB NPs exhibited an apparentpH-responsive release behavior of MB, which was released for a prolonged period in a simulated physiological environment (pH7.4) for more than 15 days and the time reduced to only 3.5 h in acidic conditions (pH 5.5). When irradiated by a 650 nm laserat 202 mW/cm 2 for 5 min, the CMC?MB NPs showed efficient bactericidal and biofilm eradication properties as well assuppression of tumor cell growth in a similar acidified microenvironment. Furthermore, in an in vivo rabbit wound bacterialinfection model, the rapid sterilization of CMC?MB NPs played a crucial role in bacterial infections, inflammation inhibition,and wound healing. As a PDT treatment against cancer, the CMC?MB NPs also exhibited an efficient antitumor therapeuticeffect in a subcutaneous tumor mice model.