Porous silicon samples with a porosity index of 5% to 80% were obtained in this work by electrochemical etching, and their photoluminescence properties were also studied. The porosity index was calculated according to the data from X-ray reflectometry. The composition of the surface was controlled by ultra-soft X-ray spectroscopy and infrared (IR) spectroscopy. The degree of the sample surface oxidation increased with the porosity enhancement. Two known mechanisms of photoluminescence in porous silicon were detected that are related to the composition and morphology of its surface. The values of the porosity index specifying the dominations of these mechanisms were determined. Enhancement of photoluminescence was shown to be attributed to an increase in the porosity index.