diff --git a/src/applications/config/check/PhabricatorSetupCheckPHPConfig.php b/src/applications/config/check/PhabricatorSetupCheckPHPConfig.php index b5edbf4e92..9c7eaa25f8 100644 --- a/src/applications/config/check/PhabricatorSetupCheckPHPConfig.php +++ b/src/applications/config/check/PhabricatorSetupCheckPHPConfig.php @@ -24,6 +24,32 @@ final class PhabricatorSetupCheckPHPConfig extends PhabricatorSetupCheck { return; } + // Check for `disable_functions` or `disable_classes`. Although it's + // possible to disable a bunch of functions (say, `array_change_key_case()`) + // and classes and still have Phabricator work fine, it's unreasonably + // difficult for us to be sure we'll even survive setup if these options + // are enabled. Phabricator needs access to the most dangerous functions, + // so there is no reasonable configuration value here which actually + // provides a benefit while guaranteeing Phabricator will run properly. + + $disable_options = array('disable_functions', 'disable_classes'); + foreach ($disable_options as $disable_option) { + if (ini_get($disable_option)) { + $message = pht( + "You have '%s' enabled in your PHP configuration.\n\n". + "This option is not compatible with Phabricator. Remove ". + "'%s' from your configuration to continue.", + $disable_option, + $disable_option); + + $this->newIssue('php.'.$disable_option) + ->setIsFatal(true) + ->setName(pht('Remove PHP %s', $disable_option)) + ->setMessage($message) + ->addPHPConfig($disable_option); + } + } + $open_basedir = ini_get('open_basedir'); if ($open_basedir) {