diff --git a/core/install.php b/core/install.php
index 1b921d6..559f699 100644
--- a/core/install.php
+++ b/core/install.php
@@ -26,6 +26,20 @@
exit;
}
+// Exit early if the PHP option safe_mode is enabled to avoid fatal errors.
+// @todo Remove this check once we require PHP > 5.4 as safe mode is deprecated
+// in PHP 5.3 and completely removed in PHP 5.4.
+if (ini_get('safe_mode')) {
+ print 'Your PHP installation has safe_mode enabled. Drupal requires the safe_mode option to be turned off. See the system requirements page for more information.';
+ exit;
+}
+
+// Exit early if the PHP option open_basedir is enabled to avoid fatal errors.
+if (ini_get('open_basedir')) {
+ print 'Your PHP installation has open_basedir enabled. Drupal requires the open_basedir option to be turned off. See the system requirements page for more information.';
+ exit;
+}
+
// Start the installer.
require_once __DIR__ . '/includes/install.core.inc';
install_drupal();