---
title: "Acquia require line"
date: "2024-02-14T06:18:38+00:00"
summary: "Discover how to properly configure your Drupal application on Acquia Cloud Platform. Learn about the essential require line in settings.php, its functions, and how to customize settings for optimal performance."
image:
type: "page"
url: "/acquia-cloud-platform/acquia-require-line"
id: "791d8534-55b7-4e3a-8a7e-fca62c711081"
---

Applications on Cloud Platform need to load a specific set of global configurations to ensure minimum basic operations are fulfilled. To achieve this, site builders must add a special code section, known as the **Acquia require line**, into the appropriate `settings.php` file in a Drupal `docroot/sites/[sitename]` folder.

Get this code from the Cloud Platform UI. Navigate to **Environment > Databases > \[Database Name\] > PHP** section. The code is similar to the following:

      if (file_exists('/var/www/site-php')) {
        require('/var/www/site-php/myappname/mydatabasename-settings.inc');
      }

The code varies according to the database that you select for the specific Drupal site instance.

To obtain and add this code to the `settings.php` file, follow the instructions in [Configuring your application to use environment databases](/node/56311#section-configuring-your-application-to-use-environment-databases)[Configuring your application to use environment databases](https://docs.acquia.com/acquia-cloud-platform/working-databases#section-configuring-your-application-to-use-environment-databases).

Important

The require line includes files and such files include variables with specific values. To override such values, you must add your custom values for the variables after the require line.

For example, by default, the `config_sync_directory` value is set to `sits/default/files/config_xxxxx`. To change this value, you must include the Acquia require line and add your custom line to override the system-defined value. The following code snippet demonstrates the method to override the system-defined value for `config_sync_directory` with config directory above the docroot.

    // Start of Acquia require line code:
    if (file_exists('/var/www/site-php')) {
      require('/var/www/site-php/myappname/mydatabasename-settings.inc');
    }
    // End of Acquia require line code.
    
    // Example: Override the config sync directory. Point to a folder outside docroot.
    $settings['config_sync_directory'] = $app_root . '/../config/' . basename($site_path);

Important

Place most settings and configuration overrides in the settings.php file after the Acquia require line. The Acquia required file can override modifications that you make before the require line.

Database connection overrides are the exception to this rule. For example, overrides that specify 'init' commands to run at database connection time include those that set browser session variables such as `wait_timeout` or `transaction isolation`. You must handle these overrides through the specific method detailed in [Overriding Drupal $databases settings](https://docs.acquia.com/acquia-cloud-platform/overriding-drupal-databases-settings)  

The file added by the Acquia require line performs the following functions:

*   Ensures that a valid version of Drupal core is installed.
*   Determines what version of Drupal core is in use.
*   Establishes the trusted host patterns for Drupal.
*   Establishes the Memcached infrastructure and connection information.
*   Builds all of the database connection information.
*   Suppresses error reporting in the production environment.
*   Sets the location of [temporary files](/acquia-cloud-platform/manage-apps/files/temporary), including the [Twig caches](../files/twig.html).