The measurement of pH has received great attention in diverse fields, such as clinical diagnostics, environmental protection, and food safety. Optical fiber sensors are widely used for pH sensing because of their great advantages. In this work, an optical fiber pH sensor is fabricated, by combining the merits of the multimode interference configuration and pH-sensitive polyaniline/polyacrylic acid (PAni/PAA) coatings, which was successfully in situ deposited on the no-core fiber (NCF) by the layer-by-layer (LBL) self-assembly method. The sensors’ performance was experimentally characterized when used for pH detection. It has a high sensitivity of 0.985 nm/pH and a great linear response in a universal pH range of 2–12. The response time and recovery time is measured to be less than 10 s. In addition, its temperature sensitivity is tested to be about 0.01 nm/°C with a low temperature crosstalk effect, which makes it promising for detecting pH in the liquid phase with temperature variation. The sensors also demonstrated easy fabrication, good stability, and repeatability, which are adapted to pH detection in most practical applications.