PACS 42.70.Qs, 81.07.Bc, 82.45.Vp For the first time, the sum-frequency generation (SFG) spectra of surface species have been measured in porous silicon (PS) layers. The range of the vibrations 2000 -2300 cm -1 for the native species Si-H x has been explored. Furthermore for the studied mesoporous materials, it has been found that, as opposed to the infrared absorption, the SFG signal increases with porosity. Finally, the angular dependence and the enhancement of the SFG signal were measured in a one-dimensional PS photonic crystal structure with a defect producing an energy level in the photonic band gap.