install.php 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?php
  2. /**
  3. * @file
  4. * Initiates a browser-based installation of Drupal.
  5. */
  6. // Change the directory to the Drupal root.
  7. chdir('..');
  8. // Store the Drupal root path.
  9. $root_path = realpath('');
  10. /**
  11. * Global flag to indicate the site is in installation mode.
  12. *
  13. * The constant is defined using define() instead of const so that PHP
  14. * versions prior to 5.3 can display proper PHP requirements instead of causing
  15. * a fatal error.
  16. */
  17. define('MAINTENANCE_MODE', 'install');
  18. // Exit early if running an incompatible PHP version to avoid fatal errors.
  19. // The minimum version is specified explicitly, as DRUPAL_MINIMUM_PHP is not
  20. // yet available. It is defined in bootstrap.inc, but it is not possible to
  21. // load that file yet as it would cause a fatal error on older versions of PHP.
  22. if (version_compare(PHP_VERSION, '5.5.9') < 0) {
  23. print 'Your PHP installation is too old. Drupal requires at least PHP 5.5.9. See the <a href="https://www.drupal.org/requirements">system requirements</a> page for more information.';
  24. exit;
  25. }
  26. if (function_exists('opcache_get_status') && opcache_get_status()['opcache_enabled'] && !ini_get('opcache.save_comments')) {
  27. print 'Systems with OPcache installed must have <a href="http://php.net/manual/en/opcache.configuration.php#ini.opcache.save-comments">opcache.save_comments</a> enabled.';
  28. exit();
  29. }
  30. // Start the installer.
  31. $class_loader = require_once $root_path . '/autoload.php';
  32. require_once $root_path . '/core/includes/install.core.inc';
  33. install_drupal($class_loader);