As a new type of detection technique, BOTDR can conduct the distributed detection of pile foundation. Based on the characteristic that BOTDR is exposed to the effects of both temperature variations and deformation, the paper develops the temperature compensation sensor, and analyzes the effect of temperature variations upon the strain sensing during the distributed detection of pile foundation. Combined with the static load test of the bored pile in the engineering site, the paper examines the measured values of temperature variations in the surrounding environment during the detection of pile foundation, and finds out from the test result that the effect of the surrounding temperature upon the pile strain is negligible. Through analyzing the pile shaft bearing capacity of the test pile under both vertical loads and horizontal loads, this paper deduces the theoretical formulae for the axial force, the side resistance, the compression, together with the deflection of the pile shaft, and then applies these calculating formulae to the practical engineering project. From the comparative analysis of the calculated results and the measured results, it can be found that these two results are almost the same, which finally proves that the distributed detection technique of BOTDR can effectively detect the pile shaft deformation under loads, and can provide the precise detection of pile foundation.