Sol-gel-based optical sensors for both gas-phase and dissolved oxygen have been developed. Both sensors operate on the principle of fluorescence quenching of a ruthenium complex which has been entrapped in a porous sol-gel silica film. A comprehensive investigation was carried out in order to establish optimal film-processing parameters for the two sensing environments. Both tetraethoxysilane and organically modified sol-gel precursors such as methyltriethoxysilane and ethyltriethoxysilane were used. Film hydrophobicity increases as a function of modified precursor content, and this was correlated with enhanced dissolved oxygen (DO) sensor performance. Extending the aliphatic group of the modified precursor further improved DO sensitivity. The influence of water/precursor molar ratio, R, on the sol-gel film microstructure was investigated. R value tailoring of the microstructure and film surface hydrophobicity tailoring were correlated with oxygen diffusion behavior in the films via the Stern-Volmer constants for both gas phase and DO sensing. Excellent performance characteristics were measured for both gas-phase and DO oxygen sensors. The long-term quenching stability of DO sensing films was established over a period of 6 months.