Skip to content

Commit

Permalink
Item12896: Make PHP flags conditional
Browse files Browse the repository at this point in the history
Otherwise apache has issues if php is not installed.

git-svn-id: http://svn.foswiki.org/trunk@17725 0b4bb1d4-4e5a-0410-9cc4-b2b747904278
  • Loading branch information
GeorgeClark authored and GeorgeClark committed May 29, 2014
1 parent 2a8965e commit b7c597d
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 18 deletions.
22 changes: 13 additions & 9 deletions core/foswiki_httpd_conf.txt
Expand Up @@ -184,15 +184,19 @@ BrowserMatch "^gsa-crawler" NO_FOSWIKI_SESSION
Allow from all
Deny from env=blockAccess

# If you have PHP4 or PHP5 installed as Apache module make sure the directive below is enabled
# If you do not have PHP installed you will need to comment out the directory below
# to avoid errors.
# If PHP is installed as CGI this flag is not needed and will in fact make Apache fail
php_admin_flag engine off

# If you have PHP3 installed as Apache module make sure the directive below is enabled
# If PHP is installed as CGI this flag is not needed and will in fact make Apache fail
#php3_engine off
# If you have PHP installed as Apache module, one of the below directives will ensure
# that it is disabled. The "ifmodule" statements should prevent this from causing
# errors if php is not installed.

<ifmodule mod_php3.c>
php3_engine off
</ifmodule>
<ifmodule mod_php4.c>
php_admin_flag engine off
</ifmodule>
<ifmodule mod_php5.c>
php_admin_flag engine off
</ifmodule>

# This line will redefine the mime type for the most common types of scripts
AddType text/plain .shtml .php .php3 .phtml .phtm .pl .py .cgi
Expand Down
22 changes: 13 additions & 9 deletions core/pub-htaccess.txt
Expand Up @@ -26,15 +26,19 @@ Options None
# script execution but it may not be 100% safe only to rely on this. The safest
# protection is to disabled all scripting.

# If you have PHP4 or PHP5 installed as Apache module make sure the directive below is enabled
# If you do not have PHP installed you will need to comment out the directory below
# to avoid errors.
# If PHP is installed as CGI this flag is not needed and will in fact make Apache fail
php_flag engine off

# If you have PHP3 installed as Apache module make sure the directive below is enabled
# If PHP is installed as CGI this flag is not needed and will in fact make Apache fail
#php3_engine off
# If you have PHP installed as Apache module, one of the below directives will ensure
# that it is disabled. The "ifmodule" statements should prevent this from causing
# errors if php is not installed.

<ifmodule mod_php3.c>
php3_engine off
</ifmodule>
<ifmodule mod_php4.c>
php_admin_flag engine off
</ifmodule>
<ifmodule mod_php5.c>
php_admin_flag engine off
</ifmodule>

# This line will redefine the mime type for the most common types of scripts
AddType text/plain .shtml .php .php3 .phtml .phtm .pl .py .cgi
Expand Down

0 comments on commit b7c597d

Please sign in to comment.