install.php 1.48 KB
Newer Older
1 2
<?php

3 4 5 6 7
/**
 * @file
 * Initiates a browser-based installation of Drupal.
 */

8 9
// Change the directory to the Drupal root.
chdir('..');
10 11
// Store the Drupal root path.
$root_path = realpath('');
12

13
/**
14
 * Global flag to indicate the site is in installation mode.
15
 *
16 17 18
 * The constant is defined using define() instead of const so that PHP
 * versions prior to 5.3 can display proper PHP requirements instead of causing
 * a fatal error.
19
 */
20
define('MAINTENANCE_MODE', 'install');
21

22
// Exit early if running an incompatible PHP version to avoid fatal errors.
23 24 25
// The minimum version is specified explicitly, as DRUPAL_MINIMUM_PHP is not
// yet available. It is defined in bootstrap.inc, but it is not possible to
// load that file yet as it would cause a fatal error on older versions of PHP.
26 27
if (version_compare(PHP_VERSION, '5.5.9') < 0) {
  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.';
28 29 30
  exit;
}

31 32 33 34 35
if (function_exists('opcache_get_status') && opcache_get_status()['opcache_enabled'] && !ini_get('opcache.save_comments')) {
  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.';
  exit();
}

36
// Start the installer.
37 38
$class_loader = require_once $root_path . '/autoload.php';
require_once $root_path . '/core/includes/install.core.inc';
39
install_drupal($class_loader);