Set Drupal System variables manually

Submitted by editor on Fri, 11/04/2016 - 11:45
Question

How to set Drupal System variables manually from a file (settings.php) ?

To set Drupal System variables you can use the $settings (on Drupal 8) and $conf (On Drupal 7) array of setting.php file.

Examples.

On Drupal 8

$settings['file_public_path'] = '/path/to/dir/public';

On Drupal 7

$conf['file_public_path'] = '/path/to/dir/public';
$conf['theme_debug'] = 1;

Local settings

You can also set local changes using a separate settings file and put your local settings into this file like:

if (file_exists(__DIR__ . '/settings.local.php')) {
   include __DIR__ . '/settings.local.php';
}

Add new comment

CAPTCHA
This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.
Image CAPTCHA
Enter the characters shown in the image.