Never been to TextSnippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world (or not, you can keep them private!)

Disallow serving of PHP pages if mod_php is not loaded (See related posts)

If mod_php doesn't load for some reason, your PHP files may be served unparsed, as plain text. This presents the possibility that your database passwords or other senstive information may be visible. Adding the following to your httpd.conf, VirtualHost container, or .htaccess file will deny access to any PHP files if the PHP module is not loaded.

<IfModule !mod_php4.c>
    <FilesMatch "\.php$">
        Order allow,deny
        Deny from all
        Allow from none
    FilesMatch>
</IfModule>


You need to create an account or log in to post comments to this site.


Related Posts