Plants are generally limited by soil phosphorus (P) deficiency in forest ecosystems. Soil available P is influenced by lithology, temperature, and soil microbes. However, the interactive effects of these factors on soil P availability in subtropical forests remain unclear. To assess their impacts, we measured soil inorganic and available P fractions and the diversity, composition, and co-occurrence network of phoD-harboring bacteria in two contrasting forest soils (lithosols in karst forests and ferralsols in non-karst forests) in the subtropical regions of southwestern China across six temperature gradients. The present results showed that the complexities in composition and network and the diversity indices of phoD-harboring bacteria were higher in the karst forest soils than those in the non-karst forest soils, with marked differences in composition. In both types of forest soils, the complexities of composition and networks and the diversity indices were higher in the high-temperature regions (mean annual temperature (MAT) > 16 °C) compared to the low-temperature regions (MAT <16 °C). Soil total inorganic and available P contents were lower in the karst forest soils compared to the non-karst forest soils. Soil total available P contents were lower in the high temperature regions than those in the low temperature regions in both forest soils, whereas soil total inorganic P contents were contrary. Variance partitioning analysis showed that soil inorganic and available P fractions were predominantly explained by lithology and its interaction with soil microbes and climate. The present findings demonstrate that soil P availability in subtropical forests of southwestern China is influenced by lithology and temperature, which regulate the diversity, composition, and network connectivity of phoD-harboring bacteria. Furthermore, this study highlights the significance of controlling the composition of phoD-harboring bacteria for mitigating plant P deficiency in karst ecosystems.