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:
- First, we will need to copy
example.settings.local.php, located in the/sitesfolder, to the/sites/defaultfolder and rename the file tosettings.local.php. - Next, we need to open
settings.php, located in the/sites/defaultfolder, and uncomment the following lines:
if (file_exists(__DIR__ . '/settings.local.php'))
{ include __DIR__ . '/settings.local.php'; } - Save the changes to our
settings.phpfile.;
With our change in place, we will need to make sure to clear Drupal's cache before our changes will take effect. Now that we have a local settings file in place, we can make a few more configuration changes that will allow us to not worry about always clearing the cache...