diff --git a/src/Commands/core/SiteInstallCommands.php b/src/Commands/core/SiteInstallCommands.php index ceaef9ee47..568b1c611f 100644 --- a/src/Commands/core/SiteInstallCommands.php +++ b/src/Commands/core/SiteInstallCommands.php @@ -269,12 +269,17 @@ public function pre(CommandData $commandData) { else { $this->logger()->info(dt('Sites directory @subdir already exists - proceeding.', array('@subdir' => $conf_path))); } + // Quietly try to make the conf_path directory writable for re-installs. + @chmod($conf_path, 0777); if (!drush_file_not_empty($settingsfile)) { if (!drush_op('copy', 'sites/default/default.settings.php', $settingsfile) && !drush_get_context('DRUSH_SIMULATE')) { throw new \Exception(dt('Failed to copy sites/default/default.settings.php to @settingsfile', array('@settingsfile' => $settingsfile))); } } + // Quietly try to make settings.php writable for re-installs. We will let the + // Drupal installer report any problems. + @chmod($settingsfile, 0666); // Write an empty sites.php if we using multi-site. if ($sitesfile_write) {