diff --git a/.htaccess b/.htaccess
index fd7bd29..93b0f31 100644
--- a/.htaccess
+++ b/.htaccess
@@ -39,6 +39,7 @@ AddEncoding gzip svgz
   php_value mbstring.http_input             pass
   php_value mbstring.http_output            pass
   php_flag mbstring.encoding_translation    off
+  php_value xdebug.max_nesting_level        256
 </IfModule>
 
 # Requires mod_expires to be enabled.
diff --git a/core/modules/system/system.install b/core/modules/system/system.install
index 4a8683e..1cc3622 100644
--- a/core/modules/system/system.install
+++ b/core/modules/system/system.install
@@ -633,6 +633,36 @@ function system_requirements($phase) {
     }
   }
 
+  // Check if xdebug.max_nesting_level is below 256, as it crashes some pages.
+  $xdebug_nesting_level = 256;
+  if (extension_loaded('xdebug') && ini_get('xdebug.max_nesting_level') < $xdebug_nesting_level) {
+
+    // Report on where correct ini file is to user.
+    $ini_scanned_files = php_ini_scanned_files();
+    $ini_location = php_ini_loaded_file();
+    if ($ini_scanned_files !== false) {
+      $ini_files = explode(',', $ini_scanned_files);
+      foreach ($ini_files as $value) {
+        if (strpos($value, 'xdebug.ini') !== FALSE) {
+          $ini_location = trim($value);
+          break;
+        }
+      }
+    }
+
+    $description = t('A max_nesting_level lower than @lvl will cause some pages in your Drupal site to crash. To fix this it is recommended to set xdebug.max_nesting_level=@lvl in your PHP configuration for Xdebug.', array('@lvl' => $xdebug_nesting_level));
+    if ($ini_location !== FALSE) {
+      $description .= ' ' . t('Your Xdebug configuration is located in @iniLocation.', array('@iniLocation' => $ini_location));
+    }
+
+    $requirements['xdebug_max_nesting_level'] = array(
+      'title' => t('Xdebug settings'),
+      'value' => t('xdebug.max_nesting_level is set to %value.', array('%value' => ini_get('xdebug.max_nesting_level'))),
+      'description' => $description,
+      'severity' => REQUIREMENT_ERROR,
+    );
+  }
+
   return $requirements;
 }
 
