pH measurement is important in many applications such as environmental science, civil engineering, biotechnology, earth science, and marine sciences. In the wellbore, the pH of the cement pore solution is around 13 at early stage, and the wellbore cement is relatively stable and less permeable above pH 10.5. However, pH drops in the CO2/H2S containing environment making the cement more porous and permeable, which leads to higher risk of wellbore integrity failure. The lower pH also makes the casing steel more susceptible to corrosion. Therefore, real time monitoring of pH in the wellbore is crucial for corrosion detection and cement failure prediction. Wellbores are often at high temperature high pressure (HTHP) conditions (> 149 °C, >1400 psi). Conventionally, pH measurement is made by a glass electrode, which is fragile, prone to drifting, and suffers from alkali interference. Furthermore, it requires a reference electrode, which becomes less stable and less reliable in HTHP conditions, hence there are only limited options available for conventional pH sensors under wellbore conditions. In the contrast, fiber optic pH sensors can offer desirable advantages such as the elimination of electrical connections and wiring and the lack of need for a separate reference electrode, making them inherently more compatible with harsh environment applications. Importantly, they can also be used for remote, distributed, and continuous pH sensing in harsh environment to enable a map of pH throughout a region of interest. Therefore, fiber optic sensors have become a promising solution for pH monitoring in the wellbore. To enable distributed pH sensing with the optical fiber platform, an optical fiber must be integrated with a pH sensitive layer along the fiber, such that the optical properties can be locally altered due to the pH change of the surrounding solution and the change is monitored by a detector in either a transmission or reflection/backscatter configuration. Therefore, the development of a stable, selective, and sensitive pH sensing layer is the critical enabling technology. Sol-gel SiO2 film is one of the most widely used substrates to immobilize pH indicators, such as organic dyes, on the optical fiber surface for pH sensing. SiO2 film has high thermal stability and excellent mechanical strength, which satisfies the HTHP wellbore conditions. The SiO2 thin film can be prepared over a large area at a comparatively low cost. Most investigations use the sol-gel SiO2 film as the substrate for immobilizing pH indicators, but very few studies have reported that the film itself can be used as a pH sensing layer. Using only SiO2 film makes the pH sensor simple to fabricate and free of leaching or photobleaching which are often encountered by the entrapped dye indicators. However, the mechanistic details of the response require elucidation to understand the potential for a selective and sensitive response as a function of pH in the presence of other chemical analytes and variations in temperature and pressure. Here we report recent results on fiber optic pH sensors utilizing porous silica based films and discuss them in the context of fundamental mechanistic considerations as well as their relevance to harsh environment sensing applications. The SiO2 film is coated onto the optical fibers through a sol-gel dip-coating method. The dip-coated fibers are calcined at temperatures of 200-600oC afterwards to obtain a porous SiO2 film of a few hundred nanometers thick. The pH sensing performance is investigated in terms of light transmission to confirm sensitivity and reversibility, and the distributed pH monitoring capability is demonstrated using an optical backscatter reflectometer. The optical fiber coated with a silica-based sol-gel and calcined at 200 °C shows good sensitivity and reversibility in the pH range from 4 to 13, and the sensor is found to be more sensitive in the alkaline region, which indicates that the developed fiber optic pH sensor has potential application in the wellbore pH range.