User Tools

Site Tools


internet:hosting:web_devel:disable_php

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
internet:hosting:web_devel:disable_php [2014/07/09 11:34]
gcooper created
internet:hosting:web_devel:disable_php [2014/07/09 11:56] (current)
gcooper
Line 1: Line 1:
-====== How To Disable PHP Using ''.htaccess'' ======+====== How To Disable PHP ====== 
 + 
 +**Securing Virtualmin**: http://servernetworktech.com/2012/11/securing-php-when-using-virtualmin/ 
 + 
 +http://stackoverflow.com/questions/8875453/how-to-allow-people-to-download-php-files-without-the-code-being-interpreted 
 + 
 +  * Make your site more secure 
 +  * Block execution of PHP in a folder 
 +  * Allow the download or display of ''.php'' files 
 +  * Uses simple ''.htaccess'' file 
 + 
 +Depending on the server configuration you need a ''.htaccess'' with: 
 + 
 +<file> 
 +# for mod_php 
 +php_value engine off 
 +</file> 
 + 
 +Or: 
 + 
 +<file> 
 +# for CGI setups 
 +Options -ExecCGI 
 +</file> 
 + 
 +Or: 
 + 
 +<file> 
 +# for FastCGI this depends on the name of the handler script 
 +RemoveHandler .php 
 +#RemoveHandler php5-fastcgi .php 
 +</file> 
 + 
 +And sometimes even a brute-force method: 
 + 
 +<file> 
 +<FilesMatch "[.]php\d?$"> 
 +   ForceType text/php 
 +   SetHandler default-handler 
 +</FilesMatch> 
 +</file> 
 + 
 +====Troubleshooting ===== 
 + 
 +Search for PHP handlers in the web server configuration: 
 + 
 +<file> 
 +grep -ri handler /etc/httpd | grep php 
 +</file>
  
internet/hosting/web_devel/disable_php.1404927241.txt.gz · Last modified: 2014/07/09 11:34 by gcooper