Configuring settings.local.php

We are all familiar with Drupal's settings.php file. However, in Drupal 8, we can now have different configurations per environment by creating a settings.local.php file that the default settings.php file can reference. This is the first step in allowing us to enable Twig debugging:

  1. First, we will need to copy example.settings.local.php, located in the /sites folder, to the /sites/default folder and rename the file to settings.local.php.
  2. Next, we need to open settings.php, located in the /sites/default folder, and uncomment the following lines:
       if (file_exists(__DIR__ . '/settings.local.php'))        { include __DIR__ . '/settings.local.php'; }  
  1. Save the changes to our settings.php file.;

With our change in place, ...

Get Mastering Drupal 8 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.