Applications on Cloud Platform load a specific set of global configurations to ensure minimum basic operations are fulfilled. This configuration exists in your application’s settings.php
file and looks similar to the following:
// On Cloud Platform, this include file configures Drupal to use the correct
// database in each site environment (Dev, Stage, or Prod). To use this
// settings.php for development on your local workstation, set $databases
// (Drupal 7 or 9+) as described in comments above.
if (file_exists('/var/www/site-php')) {
require('/var/www/site-php/myapp/myapp-settings.inc');
}
where myapp
is the docroot of your website.
Ensure that you add the require line in your settings.php
file. Otherwise, the system displays the following error:
The Settings file is not writable. The Drupal installer requires write permissions to ./sites/default/settings.php during the installation process. The webhosting issues documentation section offers help on this and other topics.
For example, by default, the config_sync_directory
value is set to sites/default/files/config_xxxxx
. To change this value, you must include the require line and add your custom line to override the system-defined value. The following code snippet shows how you can override the system-defined value for config_sync_directory
with config directory above your docroot.
if (file_exists('/var/www/site-php')) {
require '/var/www/site-php/' . $_ENV['AH_SITE_GROUP'] . '/' . $_ENV['AH_SITE_GROUP'] . '-settings.inc';
}
$settings['config_sync_directory'] = $app_root . '/../config/' . basename($site_path);
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, including the Twig caches.