Locate and edit Drupal's main configuration file

Updated on Dec 10, 2015

This tutorial will review the process of locating and editing the main configuration file of Drupal. Even if you are not a developer, the configuration file/s of a certain script is something that you should be aware of. The reason for that is because usually such files contain valuable information for your website, such as the database details, specific domain name, path to the location of your website on the server, etc.

In Drupal, the main configuration file contains a lot of details, most of them not enabled by default. The important thing to be aware here is the database details set on your website. First you need to:

Let us say that your website is accessible directly via example.com, where example.com is your actual domain name. If so, the content of your Drupal website is hosted directly within the public_html/ directory of your account. However, if you are accessing your website from a subfolder, such as example.com/drupal/, where drupal is simply a folder name, this will indicate that your Drupal installation is located within a folder called drupal and it is located within the public_html/ directory of your account.

When you locate your Drupal installation, you may proceed further and locate the actual configuration file of your script. You need to navigate to:

sites/default/settings.php

Once you locate your Drupal's configuration file, you may review it's contents in order to get a better understanding of the options that it offers. It is well documented with comments and you should not have any issues understanding them. The database details will allow you to check the name of your database, the user assigned to it, password, driver, table prefix, etc.

$databases = array (
  'default' =>
  array (
    'default' =>
    array (
      'database' => 'example_drupa61',
      'username' => 'example_drupa61',
      'password' => 'iPSC18.I-5',
      'host' => 'localhost',
      'port' => '',
      'driver' => 'mysql',
      'prefix' => 'dr_',
    ),
  ),
);
On this page...

    Drupal Hosting

    • Free Drupal Installation
    • 24/7 Drupal Support
    • Free Domain Transfer
    • Hack-free Protection
    • Fast SSD Storage
    • Free Drupal Transfer
    • Free CloudFlare CDN
    • Immediate Activation
    View More