title: How to check in .htaccess if PHP is enabled?
body: <p>How can I let Apache's <code>.htaccess</code> file check if PHP is enabled? I tried things like <code>&lt;IfModule !mod_php7.0.c&gt;</code> and <code>&lt;IfModule !mod_php7.c&gt;</code> but it doesn not seem to do anything when I enable/disable the module.</p>
  
  <p>I would like to have a fallback in my <code>.htaccess</code> that denies acces from all when PHP is disabled. In order to prevent leakage of plain text PHP code.</p>
  
  <p>I want to do something like this:</p>
  
  <pre><code># If PHP is not installed, deny all access to .php files to prevent PHP code leakage
  &lt;IfModule !mod_php7.c&gt;
      &lt;FilesMatch \.php$&gt;
          order deny,allow
          deny from all
      &lt;/FilesMatch&gt;
  &lt;/IfModule&gt;
  </code></pre>
  
  <p>Ultimately it will check something like <code>if php7 AND php5 AND php4 are disabled, deny access</code>. Any ideas?</p>
  
  <p><em>Also, when AllowOverride is None and so the <code>.htaccess</code> file is not doing anything. What are the options in order to prevent the PHP code from leaking in plaintext?</em></p>