The instability of a stratified rotating fluid layer through porous medium in the presence of an inhomogeneous magnetic field is investigated. For exponentially varying density and magnetic field variations, an eigenvalue solution has been obtained. The dispersion relation is obtained and discussed for both the stable and unstable stratifications separately. It is found, for non-porous medium, that for the stable mode of disturbance, the system is always stable, and for the unstable mode of disturbance, it is stabilized only under a certain condition for the Alfven velocity, rotation and the stratification parameter. In the latter case, both rotation and magnetic field are found to have a stabilizing effect on the growth rate. In the presence of porous medium, it is found, for real growth rate n, that the inhomogeneous magnetic field has always a stabilizing effect on the considered system. It is found also, for complex growth rate n, that the system is stable for the stable stratification case, while it is stable or unstable for the unstable case under a certain wavenumbers range depending on the Alfven velocity and the stratification parameter. The presence of the magnetic field is found to stabilize a certain wavenumbers band, whereas the system was unstable for all wavenumbers in the absence of the magnetic field. Also, the presence of porous medium is found to hide the stabilizing effect played by rotation on the considered system for non-porous medium, i.e., rotation does not have any significant effect on the stability criterion in this case.