Installing Drupal 8 (with differences between Drupal 7) on your web host

Drupal 8 is out and many of the necessary modules have been ported to version 8. Drupal 8 is quite different under the hood from Drupal 7. But it's also fun to play with straight out of the box so let's spin up a new Drupal 8 demo installation. All of this assumes you have shell access, even if you don't normally use the command line, but should be applicable whether ssh'ed to a remote Linux server or testing locally on your Mac OS X laptop. To install Drupal 8 then:

  1. Download Drupal 8 (.tar.gz) and untar it in your web root. (As of publication, the most recent version is Drupal 8.0.5 - link here.) E.g. wget

  2. On the shell, cd to sites/default. In sites/default/ copy (cp) default.settings.php to settings.php (or optionally chmod a+w . and don't copy settings.php).

  3. Create your database and any database user manually.

  4. Around line 77 of settings.php should be this section:

     * $databases['default']['default'] = array (
     *   'database' => 'databasename',
     *   'username' => 'sqlusername',
     *   'password' => 'sqlpassword',
     *   'host' => 'localhost',
     *   'port' => '3306',
     *   'driver' => 'mysql',
     *   'prefix' => '',
     *   'collation' => 'utf8mb4_general_ci',
     * );

    Copy those lines, paste it right after the uncommented line $databases = array(); and change the values for the database, username, and password, then remove all the * characters on each line. Save file.

    Actually, you needn't do any of this if you just set your files directory writeable so that the web server can create your settings.php file in Drupal 8.

  5. In 'sites/default' still, mkdir files and chmod 777 files. You will have to chmod 777 settings.php too.

  6. Navigate to your web server's root directory and go to /install.php.

  7. After installation is complete, fix permissions on settings.php: chmod go-w settings.php

  8. If your site is in a subdirectory, go into your web root, edit .htaccess, and change the RewriteBase line.

  9. Maybe restart apache.

  10. Your old Drush which worked fine on Drupal 7 needs to be upgraded for Drupal 8. This means you need Composer now too. If you don't have Composer or access to install Composer from the command line, you probably won't be using drush. But assuming you do have composer (and git):

    git clone --branch master
    cd drush
    composer install
    ln -s $(pwd)/drush /usr/local/bin/drush8

    Now you can run drush8 and still run drush for old drush.

  11. Download/install contributed themes and modules to /themes and /modules (in Drupal root) instead of /sites/all/{themes,modules}.

Installing Drupal 8 (with differences between Drupal 7) on your web host | TECH.SAIGONIST.COM



Error message

  • Warning: Cannot modify header information - headers already sent by (output started at /home/tomo/web/ in drupal_send_headers() (line 1486 of /home/tomo/web/
  • Error: Class 'CToolsCssCache' not found in _cache_get_object() (line 32 of /home/tomo/web/
The website encountered an unexpected error. Please try again later.