Ratiometric near-infrared fluorescent pH probes with various pKa values were innovatively designed and synthesized based on cyanine with a diamine moiety. The photochemical properties of these probes were thoroughly evaluated. Among the series, IR-PHA exhibited an optimal pKa value of approximately 6.40, closely matching the pH of cancerous tissues. This feature is particularly valuable for real-time pH monitoring in both living cells and living mice. Moreover, when administered intravenously to tumor-bearing mice, IR-PHA demonstrated rapid and significant enhancement of near-infrared fluorescence and photoacoustic signals within the tumor region. This outcome underscores the probe's exceptional capability for dual-modal cancer imaging utilizing near-infrared fluorescence (NIRF) and photoacoustic (PA) modalities. Concurrently, the application of a continuous-wave near-infrared laser efficiently ablated cancer cells in vivo, attributed to the photothermal effect induced by IR-PHA. The results strongly indicate that IR-PHA is well-suited for NIRF/PA dual-modality imaging and photothermal therapy of tumors. This makes it a promising candidate for theranostic applications involving small molecules.