In this paper, the physical layer security over the M-distributed fading channel is investigated. Initially, an exact expression of secrecy outage probability (SOP) is derived, which has an integral term. To get a closed-form expression, a lower bound of SOP is obtained. After that, the exact expression for the probability of strictly positive secrecy capacity (SPSC) is derived, which is in closed-form. Finally, an exact expression of ergodic secrecy capacity (ESC) is derived, which has two integral terms. To reduce its computational complexity, a closed-from expression for the lower bound of ESC is obtained. As special cases of M-distributed fading channels, the secure performance of the K, exponential, and Gamma-Gamma fading channels are also derived, respectively. Numerical results show that all theoretical results match well with Monte-Carlo simulation results. Specifically, when the average signal-to-noise ratio of main channel is larger than 40 dB, the relative errors for the lower bound of SOP, the probability of SPSC, and the lower bound of ESC are less than 1.936%, 6.753%, and 1.845%, respectively. This indicates that the derived theoretical expressions can be directly used to evaluate system performance without time-consuming simulations. Moreover, the derived results regarding parameters that influence the secrecy performance will enable system designers to quickly determine the optimal available parameter choices when facing different security risks.