Mesoporous silicon photonic crystal based composites containing silver nanoparticles are shown to provide new substrates for the improvement of SERS. The enhancement of SERS depends on the localized surface plasma resonance (LSPR) of the obtained material and the enhancement of Raman polarizability that results from the increasing interaction time of the light and matter of the multilayer structure. The electric field on the photonic crystal surface is stronger than that on the single-layer film by the finite-element time-domain method (FETD). While the surface field distribution of photonic crystals is in a narrower region from the surface than that of single-layer films. Thus, Ag nanoparticles are deposited on the two types of porous silicon samples, the enhanced electric field on the surface of photonic crystals is conducive to achieving stronger the strong LSPR response, which leads to the enhancement of Raman optical signal. SERS activity of the substrates was tested using rhodamine 6G as the probe molecules. SERS on photonic crystal device substrates are superior to that on the single-layer structure substrates, and shows a gain of five times. In addition, the enhancement of Raman signals also reduces the threshold of the detection down to $1.0\times 10^{-13}\text{M}$ . The strategy described here is a low-cost process with potential for a sensitive Raman sensor based photonic crystal for biological detection.