This happens when I use the UI and drush cex. The config.tar.gz is created in the tmp folder but nothing is created in the sync folder that I created in sites/default.

I have searched for similar tickets here, on Drupal.org and searching in google! I find references to folder and file permissions (I have tried 777 on most) and references to a .htaccess file in the sites/default folder with specific content.

The content my .htaccess file in sites/default is:

# Deny all requests from Apache 2.4+.
<IfModule mod_authz_core.c>
  Require all denied

# Deny all requests from Apache 2.0-2.2.
<IfModule !mod_authz_core.c>
  Deny from all
# Turn off all options we don't need.
Options -Indexes -ExecCGI -Includes -MultiViews

# Set the catch-all handler to prevent scripts from being executed.
SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006
<Files *>
    # Override the handler again if we're run later in the evaluation list.
    SetHandler Drupal_Security_Do_Not_Remove_See_SA_2013_003

# If we know how to do it safely, disable the PHP engine entirely.
<IfModule mod_php5.c>
  php_flag engine off

I am using the DDEV environment to create docker containers on my local Ubuntu 10.04 VM (VirtualBox) on my Windows 10 PC. I use the DDEV default settings.php for Drupal 8. I then added the following lines:

// Config sync directory.
$config_directories = array (
    CONFIG_SYNC_DIRECTORY => 'sites/default',

// Configure private file path

// Configure trusted host patters to prevent HTTP HOST header attacks
$settings['trusted_host_patterns'] = [

I have tried variations of the $config_directories definition including the commented out version. I also defined the sync directory to be 'sites/default/sync'. I have created the 'sites/default/sync' directory. I have tried deleting the config.tar.gz in the tmp directory which gives the log message 'The file tmp/config.tar.gz was not deleted because it does not exist.' and then creates the config.tar.gz file in the tmp directory.

I have tried find . -name *.tar.gz to search all the directories for any such files in case it has put it somewhere unexpected and no luck!

OK so for my versions:

Ubuntu 18.04, DDEV 0.18.0 (Nginx 1.14.0, PHP 7.1.16-1+0~20180405085551.16+jessie~1.gbp4937aa, Database 5.5.5-10.1.28-MariaDB ), Drupal 8.5.5. I have done these tests on a standard Drupal installation with the only additional module being Backup and Migrate 8.x-4.0. I have enabled a few of the core modules not enabled by the standard installation (e.g. Media).

There don't appear to be any messages in my latest Drupal error log for today (my most recent test of this bug).

Is there anything else I can supply that might help diagnose what I am doing wrong?

  • The UI only exports to a downloadable file. If you want to export configuration to the configuration folder, you need to use Drush.
    – Jaypan
    Commented Mar 22, 2019 at 0:15

1 Answer 1


The best way to store configuration is to store it outside of Drupal root directory.

For example you will have next project structure:

enter image description here


  1. config/sync is a directory with your sync configuration.
  2. public_html is a directory with your Drupal 8.

In your setting.php just add this

$config_directories['sync'] = '../config/sync';

And export your active configuration using drush

drush cex

That's all. In config/sync directory you will a files list of all your configuration.

  • That worked. Thanks. However the UI still does not work and I will be interested to find out why my directory did not work.
    – Rory
    Commented Jul 30, 2018 at 17:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.