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 Acquia 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.
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 valueThe following code snippet demonstrates the method to override the system-defined value for config_sync_directory with config directory above your 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
Any modifications made to the settings.php file should be placed after this require line. Acquia’s required file may override any modifications that you make before the require line.
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.
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 Acquia 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.
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 valueThe following code snippet demonstrates the method to override the system-defined value for config_sync_directory with config directory above your 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
Any modifications made to the settings.php file should be placed after this require line. Acquia’s required file may override any modifications that you make before the require line.
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.