Variations in the magnitude and sign of the strain in epitaxial InP directly on (001) Si are studied as a function of layer thickness using photoluminescence and x-ray diffraction techniques. The heteroepilayers were grown by low-pressure metalorganic chemical vapor deposition and showed good quality. We find that biaxial compressive strains are still present in InP layers with thickness up to 0.8 μm. The magnitudes of compressive strains are much larger than those expected from the equilibrium theory. With increasing thickness above 1 μm, the InP/Si layers suffer biaxial tensile strains as a result of differential thermal contraction during the cooling process after growth.