An analytical investigation is considered for the thermophoresis and photophoresis of a spherical aerosol particle embedded in a porous medium. The Knudsen number is assumed to be in the slip-flow regime. The porous medium is assumed to be homogenous, isotropic and the solid matrix is in thermal equilibrium with the fluid through the voids of the medium. At the surface of the particle, a temperature jump, a thermal creep, a viscous slip and thermal stress slip are considered in the analysis of motion. Expressions for thermophoretic and photophoretic velocities and forces are obtained. The effect of the Brinkman number characterizing the permeability of the medium is investigated as functions of the thermal properties of the porous medium and particle. The limiting cases of Stokes and Darcy's flows and no-slip case are discussed.