5 * Initiates a browser-based installation of Drupal.
8 use Drupal\Component\Utility\OpCodeCache;
10 // Change the directory to the Drupal root.
12 // Store the Drupal root path.
13 $root_path = realpath('');
16 * Global flag to indicate the site is in installation mode.
18 * The constant is defined using define() instead of const so that PHP
19 * versions prior to 5.3 can display proper PHP requirements instead of causing
22 define('MAINTENANCE_MODE', 'install');
24 // Exit early if running an incompatible PHP version to avoid fatal errors.
25 // The minimum version is specified explicitly, as DRUPAL_MINIMUM_PHP is not
26 // yet available. It is defined in bootstrap.inc, but it is not possible to
27 // load that file yet as it would cause a fatal error on older versions of PHP.
28 if (version_compare(PHP_VERSION, '5.5.9') < 0) {
29 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.';
33 // Initialize the autoloader.
34 $class_loader = require_once $root_path . '/autoload.php';
36 // If OPCache is in use, ensure opcache.save_comments is enabled.
37 if (OpCodeCache::isEnabled() && !ini_get('opcache.save_comments')) {
38 print 'Systems with OPcache installed must have <a href="http://php.net/manual/opcache.configuration.php#ini.opcache.save-comments">opcache.save_comments</a> enabled.';
42 // Start the installer.
43 require_once $root_path . '/core/includes/install.core.inc';
44 install_drupal($class_loader);