From 2c5ecc7967640c4d6988cac130048db208d44003 Mon Sep 17 00:00:00 2001
From: Ankur Kaneria <akaneria@ebay.com>
Date: Thu, 15 Oct 2015 14:23:43 -0500
Subject: [PATCH] MAGETWO-44112: [php7]*.htaccess  incompatibility with php 7

- Added section to check for php7 module
---
 .htaccess                      | 26 ++++++++++++++++++++++++
 dev/tests/functional/.htaccess | 37 ++++++++++++++++++++++++++++++++++
 pub/.htaccess                  | 26 ++++++++++++++++++++++++
 pub/media/.htaccess            |  5 +++++
 pub/static/.htaccess           |  4 ++++
 5 files changed, 98 insertions(+)

diff --git a/.htaccess b/.htaccess
index a0d1710a8aa..1636ce4bc50 100644
--- a/.htaccess
+++ b/.htaccess
@@ -58,6 +58,32 @@
 
 </IfModule>
 
+<IfModule mod_php7.c>
+
+############################################
+## adjust memory limit
+
+    php_value memory_limit 768M
+    php_value max_execution_time 18000
+
+############################################
+## disable automatic session start
+## before autoload was initialized
+
+    php_flag session.auto_start off
+
+############################################
+## enable resulting html compression
+
+    #php_flag zlib.output_compression on
+
+###########################################
+## disable user agent verification to not break multiple image upload
+
+    php_flag suhosin.session.cryptua off
+
+</IfModule>
+
 <IfModule mod_security.c>
 ###########################################
 ## disable POST processing to not break multiple image upload
diff --git a/dev/tests/functional/.htaccess b/dev/tests/functional/.htaccess
index 0fe8af43b87..b20b4dc2e4e 100644
--- a/dev/tests/functional/.htaccess
+++ b/dev/tests/functional/.htaccess
@@ -63,6 +63,43 @@
 
 </IfModule>
 
+<IfModule mod_php7.c>
+
+############################################
+## adjust memory limit
+
+#    php_value memory_limit 64M
+    php_value memory_limit 256M
+    php_value max_execution_time 18000
+
+############################################
+## disable magic quotes for php request vars
+
+    php_flag magic_quotes_gpc off
+
+############################################
+## disable automatic session start
+## before autoload was initialized
+
+    php_flag session.auto_start off
+
+############################################
+## enable resulting html compression
+
+    #php_flag zlib.output_compression on
+
+###########################################
+# disable user agent verification to not break multiple image upload
+
+    php_flag suhosin.session.cryptua off
+
+###########################################
+# turn off compatibility with PHP4 when dealing with objects
+
+    php_flag zend.ze1_compatibility_mode Off
+
+</IfModule>
+
 <IfModule mod_security.c>
 ###########################################
 # disable POST processing to not break multiple image upload
diff --git a/pub/.htaccess b/pub/.htaccess
index 6e6f63c4358..120d7eb5a08 100644
--- a/pub/.htaccess
+++ b/pub/.htaccess
@@ -57,6 +57,32 @@
 
 </IfModule>
 
+<IfModule mod_php7.c>
+
+############################################
+## adjust memory limit
+
+    php_value memory_limit 256M
+    php_value max_execution_time 18000
+
+############################################
+## disable automatic session start
+## before autoload was initialized
+
+    php_flag session.auto_start off
+
+############################################
+## enable resulting html compression
+
+    #php_flag zlib.output_compression on
+
+###########################################
+# disable user agent verification to not break multiple image upload
+
+    php_flag suhosin.session.cryptua off
+
+</IfModule>
+
 <IfModule mod_security.c>
 ###########################################
 # disable POST processing to not break multiple image upload
diff --git a/pub/media/.htaccess b/pub/media/.htaccess
index f2751570906..865ebd31b52 100644
--- a/pub/media/.htaccess
+++ b/pub/media/.htaccess
@@ -1,8 +1,13 @@
 Options All -Indexes
+
 <IfModule mod_php5.c>
 php_flag engine 0
 </IfModule>
 
+<IfModule mod_php7.c>
+php_flag engine 0
+</IfModule>
+
 AddHandler cgi-script .php .pl .py .jsp .asp .htm .shtml .sh .cgi
 Options -ExecCGI
 
diff --git a/pub/static/.htaccess b/pub/static/.htaccess
index c96881a49c6..56ceaf05709 100644
--- a/pub/static/.htaccess
+++ b/pub/static/.htaccess
@@ -2,6 +2,10 @@
 php_flag engine 0
 </IfModule>
 
+<IfModule mod_php7.c>
+php_flag engine 0
+</IfModule>
+
 # To avoid situation when web server automatically adds extension to path
 Options -MultiViews
 
-- 
GitLab