Information for: DEVELOPERS   PARTNERS

Temporary files

The temporary files directory in Drupal is the location on your web server where Drupal core and contributed modules upload files for processing.

Acquia’s require line in your website’s settings.php file configures the location of your temporary files directory to /mnt/tmp/[sitename].[env], where [sitename] is your application name and [env] is the environment. This location is available to you as an environment variable.

For more information about your application name, see the Sitename definition page. For a full list of Acquia Cloud file locations, see File locations.


Do not set the temporary directory to /tmp. The /tmp directory is smaller than /mnt/tmp/[sitename].[env], and may quickly fill up.

Twig files and the temporary directory

For Drupal 8 websites, Acquia’s require line sets a per-environment temporary directory location for compiled Twig templates to /mnt/tmp/[sitename][env]/php_storage/twig, where [sitename] is your application name and [env] is the environment.

This directory stores the Twig cache files for all websites hosted by the environment, as described in this known issue.


  • Clearing the Twig cache for a website clears the Twig cache directory for all websites hosted by this environment.

  • Clearing caches concurrently for several websites that share the same Twig cache directory can cause PHP errors, which can include the following error message:

    DirectoryIterator::__construct(/mnt/tmp/sitename/php_storage/twig/twig/filename.twig_hash): failed to open dir: No such file or directory

Modules and the temporary directory

Drupal modules that write to temporary directories may require additional configuration to function properly in environments with multiple web servers, such as production environments for Acquia Cloud Enterprise and Acquia Cloud Site Factory. For more information, see Additional module issues and the following lists of modules: